/* auction.chaddi.lk — mobile-first, no build step */

:root {
  --ink: #16181d;
  --ink-soft: #4b5160;
  --paper: #faf8f4;
  --card: #ffffff;
  --line: #e7e2d8;
  --navy: #12213f;
  --navy-dark: #0a1526;
  --gold: #c8912a;
  --gold-light: #f4c968;
  --green: #1a7a4c;
  --red: #b3392c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(18, 33, 63, 0.08), 0 6px 16px rgba(18, 33, 63, 0.06);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }

/* ---- top nav ---- */
.topbar { background: var(--navy); color: #fff; }
.topbar .wrap { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.25rem; color: #fff; letter-spacing: -0.02em; }
.brand span { color: var(--gold-light); }
.searchbar { flex: 1 1 220px; display: flex; }
.searchbar input { flex: 1; border: none; border-radius: 6px 0 0 6px; padding: .55rem .75rem; font-size: .95rem; }
.searchbar button { border: none; background: var(--gold); color: var(--navy-dark); font-weight: 700; padding: .55rem .9rem; border-radius: 0 6px 6px 0; cursor: pointer; }
.navlinks { display: flex; gap: .9rem; align-items: center; font-size: .9rem; flex-wrap: wrap; }
.navlinks a { color: #dfe4ee; }
.navlinks a:hover { color: #fff; }
.btn-pill { background: var(--gold); color: var(--navy-dark) !important; padding: .4rem .9rem; border-radius: 999px; font-weight: 700; }

.subnav { background: var(--navy-dark); }
.subnav .wrap { display: flex; gap: 1rem; padding: .5rem 1rem; overflow-x: auto; white-space: nowrap; }
.subnav a { color: #b9c2d6; font-size: .85rem; }
.subnav a:hover { color: #fff; }

/* ---- buttons/forms ---- */
.btn {
  display: inline-block; border: none; border-radius: 8px; padding: .6rem 1.1rem;
  font-weight: 700; font-size: .95rem; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--navy-dark); }
.btn-gold:hover { background: var(--gold-light); text-decoration: none; }
.btn-outline { background: transparent; border: 1.5px solid var(--navy); color: var(--navy); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; }

form.stack label { display: block; font-weight: 600; font-size: .85rem; margin: .8rem 0 .3rem; }
form.stack input[type=text], form.stack input[type=email], form.stack input[type=password],
form.stack input[type=number], form.stack input[type=tel], form.stack input[type=datetime-local],
form.stack select, form.stack textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; background: #fff;
}
form.stack .checkbox-row { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; }
form.stack .checkbox-row input { width: auto; }
.helptext { color: var(--ink-soft); font-size: .8rem; }
.errorlist { color: var(--red); list-style: none; padding: 0; margin: .2rem 0; font-size: .85rem; }

/* ---- messages ---- */
.messages { list-style: none; margin: .75rem 0; padding: 0; }
.messages li { padding: .6rem .9rem; border-radius: 8px; margin-bottom: .5rem; font-size: .9rem; }
.messages .success { background: #e4f5ec; color: var(--green); }
.messages .error { background: #fbe8e5; color: var(--red); }
.messages .info, .messages .warning { background: #fff3da; color: #8a5b12; }

/* ---- layout helpers ---- */
.section { padding: 1.5rem 0; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .9rem; }
.section-title h2 { font-size: 1.15rem; }
.grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 920px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1160px) { .grid { grid-template-columns: repeat(5, 1fr); } }

.layout-2col { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 860px) { .layout-2col { grid-template-columns: 230px 1fr; } }
.layout-2col-r { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 860px) { .layout-2col-r { grid-template-columns: 1fr 320px; } }

/* ---- cards ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-body { padding: 1rem; }

.listing-card { display: flex; flex-direction: column; height: 100%; }
.listing-card .thumb { aspect-ratio: 1/1; background: #f1ede4; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.listing-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing-card .thumb .ph { color: #b7ae9c; font-size: .8rem; }
.listing-card .info { padding: .65rem .75rem; flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.listing-card .title { font-size: .88rem; font-weight: 600; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing-card .price { font-weight: 800; color: var(--navy); font-size: 1rem; }
.listing-card .meta { font-size: .75rem; color: var(--ink-soft); }

.badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: .2rem .5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.badge-auction { background: #fdeed0; color: #8a5b12; }
.badge-fixed { background: #dce8ff; color: #1b3a80; }
.badge-new { background: #e4f5ec; color: var(--green); }
.badge-used { background: #f0eee9; color: var(--ink-soft); }
.badge-featured { background: var(--gold); color: var(--navy-dark); }
.badge-status { background: #eee; color: #555; }

/* ---- listing detail ---- */
.pdp-gallery img { border-radius: var(--radius); border: 1px solid var(--line); }
.pdp-thumbs { display: flex; gap: .4rem; margin-top: .5rem; overflow-x: auto; }
.pdp-thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.price-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.price-box .amount { font-size: 1.9rem; font-weight: 800; color: var(--navy); }
.auction-timer { background: var(--navy-dark); color: #fff; border-radius: 8px; padding: .6rem .8rem; font-size: .85rem; margin: .6rem 0; }
.bid-list { list-style: none; padding: 0; margin: .5rem 0; font-size: .85rem; }
.bid-list li { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px solid var(--line); }

table.plain { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.plain th, table.plain td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); }

.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin: 1rem 0; }
@media (min-width: 640px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem; }
.stat-tile .n { font-size: 1.4rem; font-weight: 800; color: var(--navy); }
.stat-tile .l { font-size: .78rem; color: var(--ink-soft); }

.dash-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dash-tabs a { padding: .4rem .8rem; border-radius: 999px; background: #eee; font-size: .82rem; color: var(--ink-soft); }
.dash-tabs a.active { background: var(--navy); color: #fff; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft); }

footer { background: var(--navy-dark); color: #b9c2d6; margin-top: 2.5rem; padding: 2rem 0; font-size: .85rem; }
footer a { color: #dfe4ee; }
footer .cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 640px) { footer .cols { grid-template-columns: repeat(4, 1fr); } }

.msg-bubble { max-width: 80%; padding: .5rem .7rem; border-radius: 10px; margin-bottom: .5rem; font-size: .9rem; }
.msg-mine { background: var(--navy); color: #fff; margin-left: auto; }
.msg-theirs { background: #eee; }

.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%); color: #fff; padding: 2.2rem 0; }
.hero h1 { font-size: 1.7rem; margin-bottom: .4rem; }
.hero p { color: #cfd6e6; }
.cat-pills { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.cat-pills a { background: rgba(255,255,255,.12); color: #fff; padding: .35rem .75rem; border-radius: 999px; font-size: .82rem; }
.cat-pills a:hover { background: var(--gold); color: var(--navy-dark); text-decoration: none; }
