:root {
  --navy: #17304a;
  --navy-2: #1f4362;
  --teal: #2f7d92;
  --teal-dark: #1f6577;
  --bid-green: #12795f;
  --red: #dc2626;
  --bg: #f2f5f8;
  --card: #ffffff;
  --border: #e2e7ec;
  --text: #1c2b3a;
  --text-muted: #6b7785;
  --link: #2f5f8f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.topbar {
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #cfe0ec;
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
  letter-spacing: 0.2px;
}

header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(23, 48, 74, 0.06);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  font-size: 21px;
  font-weight: 800;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.2px;
}

.nav-links {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-weight: 600;
}

.nav-links a {
  color: var(--navy);
  text-decoration: none;
}
.nav-links a:hover { color: var(--teal); }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 8px 14px;
  border-radius: 20px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5c5c;
  box-shadow: 0 0 6px #ff5c5c;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero {
  background: linear-gradient(120deg, var(--navy) 0%, var(--teal-dark) 100%);
  color: #fff;
  padding: 40px 20px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.3px;
}

.hero p {
  margin: 0;
  color: #cfe0ec;
  font-size: 15px;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(23, 48, 74, 0.05);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(23, 48, 74, 0.12);
}

.card-media {
  position: relative;
}

.card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  background: #eef1f4;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 5px 10px;
  border-radius: 4px;
}

.card-body {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.card-body h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-row {
  font-size: 13px;
  color: var(--text-muted);
}
.meta-row strong { color: var(--text); }

.countdown {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 5px;
}

.countdown.ending-soon { color: var(--red); }
.countdown.ended { color: var(--text-muted); }

.bid-row {
  margin-top: 2px;
}

.bid-row .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
}

.bid-amount {
  font-size: 21px;
  font-weight: 800;
  color: var(--bid-green);
}

.bid-amount.flash {
  animation: flash 0.6s ease;
}

@keyframes flash {
  0% { color: var(--red); transform: scale(1.08); }
  100% { color: var(--bid-green); transform: scale(1); }
}

.card-footer {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--link);
}
.card:hover .card-footer { text-decoration: underline; }

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--link);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

.listing-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
}

@media (max-width: 720px) {
  .listing-detail { grid-template-columns: 1fr; padding: 18px; }
}

.listing-detail img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.listing-detail h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin-top: 0;
}

.current-bid-box {
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 18px 0;
}

.current-bid-box .label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.current-bid-box .amount {
  font-size: 36px;
  font-weight: 800;
  color: var(--bid-green);
}

.current-bid-box .bidder {
  font-size: 13px;
  color: var(--text-muted);
}

.current-bid-box .countdown {
  font-size: 14px;
}

form.bid-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.bid-form input {
  background: #fff;
  border: 1px solid #c7d0d9;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 15px;
}

.bid-form input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 125, 146, 0.15);
}

.bid-form button {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 13px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.bid-form button:hover { background: var(--navy-2); }
.bid-form button:disabled { background: #9aa7b3; cursor: not-allowed; }

.form-message {
  font-size: 13px;
  min-height: 18px;
  font-weight: 600;
}
.form-message.error { color: var(--red); }
.form-message.success { color: var(--bid-green); }

.bid-history {
  margin-top: 24px;
}

.bid-history h4 {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bid-history ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.bid-history li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.bid-history li:last-child { border-bottom: none; }

.bid-history li:first-child {
  color: var(--text);
  font-weight: 700;
  background: #f7fafc;
}

.sample-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding: 30px 20px 10px;
}
