:root {
  --navy-950: #081828;
  --navy-900: #0c2236;
  --navy-800: #122e48;
  --navy-700: #1a3a5c;
  --copper: #e06020;
  --copper-hover: #c95217;
  --copper-soft: #fdeee3;
  --gold: #e8922e;
  --blue: #216ba5;

  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #1a2330;
  --ink-soft: #3c4655;
  --muted: #6b7482;
  --border: #e6e9ee;
  --border-strong: #d5dae2;

  --green: #0f7a4d;
  --green-soft: #e6f4ed;
  --red: #d5230d;
  --red-soft: #fdecea;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(12,34,54,.05);
  --shadow: 0 1px 3px rgba(12,34,54,.07), 0 2px 10px rgba(12,34,54,.04);
  --shadow-lg: 0 14px 40px rgba(12,34,54,.12);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--copper); text-decoration: none; }
a:hover { color: var(--copper-hover); }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ===== Navbar ===== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 800; font-size: 1.28rem; letter-spacing: -.01em; }
.brand img { height: 44px; width: auto; border-radius: 6px; object-fit: contain; }
.brand .brand-name { display: flex; flex-direction: column; line-height: 1.12; }
.brand .brand-name small { font-weight: 600; font-size: .7rem; color: var(--copper); letter-spacing: .06em; text-transform: uppercase; }
.brand b { color: var(--navy-800); }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  color: var(--ink-soft); font-size: .92rem; font-weight: 600; padding: 8px 13px; border-radius: 9px;
  transition: background .15s, color .15s;
}
.nav-links a:hover { color: var(--navy-800); background: var(--bg); }
.nav-links a.active { color: var(--navy-800); background: var(--copper-soft); }
.nav-auth { display: inline-flex; align-items: center; gap: 8px; }

/* Hamburger toggle (mobile only) */
.nav-toggle {
  display: none;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--ink); font-size: 1.3rem; line-height: 1;
  width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
  align-items: center; justify-content: center;
}

main { flex: 1; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(155deg, var(--navy-950) 0%, var(--navy-800) 60%, var(--navy-700) 130%);
  color: #fff; padding: 60px 0 90px; position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; right: -100px; top: -80px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(224,96,32,.4), transparent 62%); border-radius: 50%;
}
.hero::after {
  content: ""; position: absolute; left: -60px; bottom: -120px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(33,107,165,.35), transparent 60%); border-radius: 50%;
}
.hero-inner { position: relative; z-index: 1; max-width: 720px; }
.hero .eyebrow {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #f8c7a0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  padding: 5px 12px; border-radius: 20px; margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.1; letter-spacing: -.01em; margin-bottom: 14px;
}
.hero h1 em { font-style: italic; color: #f8c7a0; }
.hero p { color: rgba(255,255,255,.84); font-size: 1.06rem; max-width: 560px; }

/* ===== Search bar (floating) ===== */
.search-wrap { margin-top: -46px; position: relative; z-index: 5; margin-bottom: 40px; }
.search-box {
  display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-lg);
}
.search-box .field { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 3px; }
.search-box .field label { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-left: 2px; }
.search-box input, .search-box select {
  width: 100%; border: none; outline: none; background: transparent; font-size: .98rem;
  color: var(--ink); font-family: var(--font-body); padding: 7px 2px;
}
.search-box select { cursor: pointer; }
.search-box .btn { align-self: center; }

/* ===== Banner strip ===== */
.banner-strip { display: flex; gap: 14px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 6px; }
.banner {
  background: linear-gradient(135deg, var(--copper), var(--gold));
  color: #fff; border-radius: var(--radius); padding: 18px 22px;
  display: flex; align-items: center; gap: 14px; min-width: 260px; box-shadow: var(--shadow);
  font-weight: 700; transition: transform .15s, box-shadow .15s;
}
.banner:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.banner img { height: 46px; border-radius: 9px; }

/* ===== Section header ===== */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 18px; }
.section-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.65rem; letter-spacing: -.01em; color: var(--navy-900); }
.section-head .more { font-size: .9rem; font-weight: 600; }

/* ===== Category chips ===== */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 40px; padding: 9px 17px; font-size: .9rem; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; transition: all .15s; box-shadow: var(--shadow-sm);
}
.chip:hover { border-color: var(--copper); color: var(--copper); }
.chip.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip .emoji { font-size: 1.05rem; }

/* ===== Listing grid & cards ===== */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; color: var(--ink); display: flex; flex-direction: column;
  transition: box-shadow .18s, transform .18s, border-color .18s; box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--border-strong); color: var(--ink); }
.card-media {
  height: 170px; background: linear-gradient(135deg, var(--navy-800), var(--blue));
  display: flex; align-items: center; justify-content: center; position: relative;
}
.card-media.coin { background: linear-gradient(135deg, #2f5f6b, #1a3a5c); }
.card-media .media-emoji { font-size: 3.2rem; filter: drop-shadow(0 3px 6px rgba(0,0,0,.3)); }
.card-media .tag {
  position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.95); color: var(--navy-800);
  font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
}
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 1.05rem; font-weight: 700; color: var(--ink); line-height: 1.35; }
.card-body .cond { font-size: .8rem; color: var(--muted); }
.card-price { font-size: 1.3rem; font-weight: 800; color: var(--navy-800); }
.card-price small { font-size: .8rem; color: var(--muted); font-weight: 600; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.card-foot .bids { font-weight: 700; color: var(--copper); }
.card-seller { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--muted); }
.card-seller .avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--copper-soft); color: var(--copper);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .72rem;
}

/* ===== Buttons & forms ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--copper); color: #fff; border: none; border-radius: 10px;
  padding: 11px 20px; font-size: .95rem; cursor: pointer; font-weight: 700;
  transition: background .15s, box-shadow .15s, transform .1s; box-shadow: var(--shadow-sm);
  font-family: var(--font-body);
}
.btn:hover { background: var(--copper-hover); color: #fff; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 14px; font-size: .84rem; border-radius: 8px; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--ink-soft); box-shadow: none; }
.btn-ghost:hover { background: var(--bg); color: var(--ink); border-color: var(--border-strong); }
.btn-navy { background: var(--navy-800); }
.btn-navy:hover { background: var(--navy-900); }

input, select, textarea {
  width: 100%; background: var(--surface); border: 1.5px solid var(--border);
  color: var(--ink); border-radius: 10px; padding: 12px 14px; font-size: .96rem;
  margin: 6px 0 14px; outline: none; transition: border-color .15s, box-shadow .15s;
  font-family: var(--font-body);
}
input:focus, select:focus, textarea:focus { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(224,96,32,.12); }
label { font-size: .85rem; color: var(--ink-soft); font-weight: 700; }

.error { color: var(--red); font-size: .85rem; margin-top: 6px; min-height: 1em; }
.muted { color: var(--muted); }

/* ===== Auth card ===== */
.auth-card {
  max-width: 430px; margin: 48px auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; padding: 32px; box-shadow: var(--shadow);
}
.auth-card.wide { max-width: 600px; }
.auth-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; margin-bottom: 6px; color: var(--navy-900); }
.auth-card .sub { color: var(--muted); margin-bottom: 22px; font-size: .95rem; }

/* ===== Detail page ===== */
.detail-wrap { display: grid; grid-template-columns: 1fr 350px; gap: 28px; }
.gallery { margin: 20px 0; }
.gallery-main { width: 100%; height: 360px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); background: #f3f4f6; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid var(--border); transition: border-color .15s; }
.gallery-thumbs img.active, .gallery-thumbs img:hover { border-color: var(--copper); }
.detail-main h1 { font-family: var(--font-display); font-weight: 600; font-size: 2rem; margin: 12px 0 6px; line-height: 1.15; color: var(--navy-900); }
.badge {
  display: inline-block; background: var(--copper-soft); color: var(--copper);
  padding: 5px 13px; border-radius: 20px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
}
.detail-hero {
  height: 300px; border-radius: var(--radius); margin: 20px 0;
  background: linear-gradient(135deg, var(--navy-800), var(--blue));
  display: flex; align-items: center; justify-content: center;
}
.detail-hero .media-emoji { font-size: 5rem; filter: drop-shadow(0 5px 10px rgba(0,0,0,.3)); }
.price-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin: 20px 0; box-shadow: var(--shadow-sm);
}
.price-box .label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.big-price { font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; color: var(--navy-800); margin: 4px 0; }
.countdown { margin-bottom: 16px; font-weight: 600; color: var(--ink-soft); }
.bid-form { display: flex; gap: 10px; flex-wrap: wrap; }
.bid-form input { flex: 1; margin: 0; min-width: 150px; }

.detail-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); height: fit-content; }
.detail-side h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--navy-900); }
.bid-list { list-style: none; margin-top: 12px; }
.bid-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.bid-list .amt { color: var(--navy-800); font-weight: 800; }
.bid-list .time { color: var(--muted); font-size: .8rem; }

/* ===== Dashboard ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 16px 0 26px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.stat-card .label { font-size: .8rem; color: var(--muted); font-weight:600; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .big { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--navy-800); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.inline-form input { flex: 1; min-width: 120px; margin: 0; }
h3 { margin: 26px 0 10px; font-weight: 800; color: var(--navy-900); font-size: 1.15rem; }

.footer { background: var(--navy-950); color: rgba(255,255,255,.72); padding: 26px 0; font-size: .86rem; margin-top: 40px; }
.footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer b { color: #fff; }

/* ===== Badge notif ===== */
.badge-num {
  display: inline-block; background: var(--red); color: #fff; border-radius: 10px;
  padding: 0 7px; font-size: .72rem; font-weight: 800; margin-left: 3px; line-height: 1.5;
}

/* ===== Chat ===== */
.chat-shell { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
.chat-list-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); height: fit-content; }
.chat-list-pane h3 { font-family: var(--font-display); font-weight: 600; color: var(--navy-900); margin-top: 0; }
.chat-main-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 420px; box-shadow: var(--shadow-sm); }
.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 420px; gap: 10px; }
.chat-empty .big-emoji { font-size: 3rem; }
.chat-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.chat-input { display: flex; gap: 10px; margin-top: 12px; }
.chat-input input { flex: 1; margin: 0; }
.conv-item { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; color: var(--ink); font-weight: 600; transition: border-color .15s, background .15s; }
.conv-item:hover { border-color: var(--copper); background: var(--copper-soft); color: var(--ink); }
.status-tag { position: absolute; top: 12px; right: 12px; background: var(--copper); color: #fff; }
.status-tag.scheduled { background: var(--blue); }
.chat-layout { display: grid; grid-template-columns: 290px 1fr; gap: 20px; }
.chat-detail-full { max-width: 740px; }
.message-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; min-height: 340px; }
.msg { display: flex; flex-direction: column; }
.msg.mine { align-items: flex-end; }
.msg .bubble {
  max-width: 74%; padding: 11px 16px; border-radius: 15px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.msg.mine .bubble { background: var(--navy-800); color: #fff; border: none; }
.msg .time { font-size: .7rem; color: var(--muted); margin-top: 3px; }

/* ===== 404 ===== */
.notfound { text-align: center; padding: 80px 0; }
.notfound h1 { font-family: var(--font-display); font-size: 4rem; color: var(--navy-800); }

/* ===== Image upload (create form) ===== */
.dropzone {
  position: relative; border: 2px dashed var(--border-strong); border-radius: 12px;
  padding: 34px 16px; text-align: center; cursor: pointer; background: var(--surface);
  transition: border-color .15s, background .15s; margin-bottom: 12px;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--copper); background: var(--copper-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.dz-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.dz-plus {
  width: 52px; height: 52px; border-radius: 50%; background: var(--copper-soft); color: var(--copper);
  font-size: 2rem; font-weight: 600; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.dz-text { font-weight: 700; color: var(--ink-soft); }
.dz-hint { font-size: .78rem; color: var(--muted); }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-bottom: 14px; }
.preview-grid .pv {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
}
.preview-grid .pv img { width: 100%; height: 100%; object-fit: cover; }
.preview-grid .pv .rm {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none; cursor: pointer; font-size: .9rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-col input { margin: 6px 0 0; }
@media (max-width: 900px) {
  .container { padding: 0 16px; }
}

@media (max-width: 760px) {
  /* ===== Mobile navbar (hamburger) ===== */
  .nav-inner { height: 60px; gap: 10px; }
  .brand img { height: 36px; width: auto; }
  .brand { font-size: 1.1rem; }
  .brand .brand-name small { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px;
    display: none; box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 10px; font-size: 1rem; border-radius: 8px; }
  .nav-auth { flex-direction: column; align-items: stretch; gap: 4px; margin-top: 6px; }
  .nav-auth a { text-align: center; }

  /* ===== Hero ===== */
  .hero { padding: 36px 0 76px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: .95rem; }

  /* ===== Search ===== */
  .search-wrap { margin-top: -34px; margin-bottom: 28px; }
  .search-box { padding: 10px; gap: 6px; }
  .search-box .field { min-width: 100%; }
  .search-box .btn { width: 100%; margin-top: 4px; }

  /* ===== Chips ===== */
  .chips { gap: 8px; margin-bottom: 18px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .chip { white-space: nowrap; padding: 8px 14px; font-size: .84rem; }

  /* ===== Section head ===== */
  .section-head { margin: 24px 0 14px; }
  .section-head h2 { font-size: 1.35rem; }

  /* ===== Cards ===== */
  .listing-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-media { height: 120px; }
  .card-body { padding: 12px; gap: 5px; }
  .card-body h3 { font-size: .92rem; }
  .card-price { font-size: 1.1rem; }
  .card-foot { font-size: .74rem; }
  .card-seller { font-size: .74rem; }

  /* ===== Detail ===== */
  .detail-wrap { grid-template-columns: 1fr; gap: 20px; }
  .detail-main h1 { font-size: 1.5rem; }
  .gallery-main { height: 260px; }
  .gallery-thumbs img { width: 60px; height: 60px; }
  .big-price { font-size: 2rem; }
  .price-box { padding: 18px; }
  .bid-form { flex-direction: column; }
  .bid-form input { min-width: 100%; }
  .bid-form .btn { width: 100%; }

  /* ===== Auth ===== */
  .auth-card { margin: 20px auto; padding: 22px; border-radius: 14px; }
  .auth-card h1 { font-size: 1.4rem; }

  /* ===== Dashboard ===== */
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .big { font-size: 1.3rem; }

  /* ===== Chat ===== */
  .chat-layout { grid-template-columns: 1fr; }
  .chat-shell { grid-template-columns: 1fr; }

  /* ===== Footer ===== */
  .footer { padding: 20px 0; }
  .footer .container { flex-direction: column; text-align: center; }
}

@media (max-width: 380px) {
  .listing-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
}
