/* ═══════════════════════════════════════════════
   KadaiBid — eBay-inspired Design System
   Font: DM Sans (body) + Syne (brand/headings)
   Palette: Trust blue, commerce gold, clean white
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ── Tokens ── */
:root {
  --bg:          #f5f5f5;
  --surface:     #ffffff;
  --surface-2:   #f8f8f8;
  --border:      #e2e2e2;
  --border-focus:#0064d2;

  --text:        #111111;
  --text-2:      #555555;
  --text-3:      #888888;

  --blue:        #0064d2;
  --blue-dark:   #004aad;
  --blue-light:  #e8f0fb;
  --gold:        #f5af02;
  --gold-bg:     #fffbea;
  --red:         #d9232d;
  --red-bg:      #fff0f0;
  --green:       #1a7a42;
  --green-bg:    #edf7f1;

  --radius:      8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 2px 8px rgba(0,0,0,.10);
  --shadow-lg:   0 4px 20px rgba(0,0,0,.12);

  --nav-h:       60px;
  --font:        'DM Sans', sans-serif;
  --font-brand:  'Syne', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 24px;
  box-shadow: var(--shadow-sm);
}
.brand {
  font-family: var(--font-brand);
  font-size: 22px; font-weight: 800;
  color: var(--text) !important;
  text-decoration: none !important;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -.5px;
  flex-shrink: 0;
}
.mark {
  background: var(--blue);
  color: #fff;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 14px;
  letter-spacing: 0;
}
.navlinks {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.navlinks a {
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  text-decoration: none !important;
}
.navlinks a:hover { color: var(--text); background: var(--surface-2); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue); color: #fff !important;
  font-weight: 600; font-size: 14px;
  padding: 9px 18px; border-radius: 25px;
  border: none; cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  text-decoration: none !important;
  white-space: nowrap;
  letter-spacing: .1px;
}
.btn:hover { background: var(--blue-dark); box-shadow: 0 2px 8px rgba(0,100,210,.3); }
.btn:active { transform: scale(.98); }
.btn.secondary {
  background: var(--surface);
  color: var(--blue) !important;
  border: 1.5px solid var(--blue);
}
.btn.secondary:hover { background: var(--blue-light); box-shadow: none; }
.btn.wa {
  background: #25D366; color: #fff !important;
}
.btn.wa:hover { background: #1ab855; box-shadow: 0 2px 8px rgba(37,211,102,.3); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #b51d26; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Layout ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}
.sticky { position: sticky; top: calc(var(--nav-h) + 16px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #003e9c 0%, #0064d2 60%, #0084ff 100%);
  color: #fff;
  padding: 72px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero h1 {
  font-family: var(--font-brand);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  margin-bottom: 16px;
  position: relative;
  letter-spacing: -1px;
}
.hero p {
  font-size: 16px; color: rgba(255,255,255,.85);
  max-width: 540px; margin: 0 auto 28px;
  position: relative; line-height: 1.6;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; }
.hero-actions .btn { padding: 11px 24px; font-size: 15px; }
.hero-actions .btn.secondary { color: #fff !important; border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.1); }
.hero-actions .btn.secondary:hover { background: rgba(255,255,255,.2); }

/* ── Page Header ── */
.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.page-head .container {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--font-brand);
  font-size: 24px; font-weight: 800;
  letter-spacing: -.5px;
}

/* ── Panel ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.panel h3 {
  font-size: 15px; font-weight: 700; margin-bottom: 4px;
}

/* ── Filters ── */
.filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 16px 0;
}
.filter {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  transition: all .15s;
}
.filter:hover { border-color: var(--blue); color: var(--blue); }
.filter.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ── Auction Card ── */
.auction-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s;
  box-shadow: var(--shadow-sm);
}
.auction-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.image-box {
  position: relative; overflow: hidden;
  background: #f0f0f0;
}
.image-box img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.auction-card:hover .image-box img { transform: scale(1.03); }
.placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: #ccc;
  background: linear-gradient(135deg, #f5f5f5, #ebebeb);
}
.card-body { padding: 14px 16px; flex: 1; }
.card-title {
  font-weight: 700; font-size: 14px; margin: 6px 0 6px;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.bid-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: 10px;
}

/* ── Tags / Badges ── */
.tag {
  display: inline-block;
  background: var(--blue-light); color: var(--blue);
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .5px;
}
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .5px;
}
.badge.live    { background: #e6f9ee; color: #1a7a42; }
.badge.ending  { background: #fff3e0; color: #c45200; }
.badge.closed  { background: #f0f0f0; color: #888; }

/* ── Typography utilities ── */
.label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.small { font-size: 13px; color: var(--text-2); }
.hint  { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.meta  { font-size: 13px; color: var(--text-2); }
.money { font-size: 20px; font-weight: 800; color: var(--text); font-family: var(--font-brand); letter-spacing: -.5px; }
.money.hero { font-size: 38px; color: #fff; line-height: 1; }
.time  { font-size: 14px; font-weight: 700; color: var(--text); }
.urgency.ending { color: #c45200; font-weight: 700; font-size: 13px; }
.urgency.live   { color: var(--green); font-weight: 600; font-size: 13px; }
.urgency.closed { color: var(--text-3); font-size: 13px; }

/* ── Notice ── */
.notice {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  margin-top: 12px;
  line-height: 1.5;
  border-left: 3px solid transparent;
}
.notice.info  { background: var(--blue-light); border-color: var(--blue); color: #004aad; }
.notice.ok    { background: var(--green-bg); border-color: var(--green); color: #145c33; }
.notice.err   { background: var(--red-bg); border-color: var(--red); color: #991f25; }
.notice.warn  { background: var(--gold-bg); border-color: var(--gold); color: #7a5200; }

/* ── Form ── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.form-card h2, .form-card h3 {
  font-family: var(--font-brand);
  font-weight: 800; letter-spacing: -.3px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
label {
  display: block;
  font-size: 12px; font-weight: 700;
  color: var(--text-2); text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 6px;
}
input[type="text"], input[type="number"], input[type="date"],
input[type="time"], input[type="datetime-local"], input[type="file"],
input:not([type]), select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,100,210,.1);
}
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ── Bid history ── */
.bid-history { margin-top: 0; }
.history-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.history-row:first-of-type { border-top: 1px solid var(--border); }
.history-row strong { font-weight: 700; font-family: var(--font-brand); }

/* ── Auction detail layout ── */
.auction-hero-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.auction-hero-panel .image-box { height: 420px; }
.auction-info { padding: 24px; }
.auction-info h1 {
  font-family: var(--font-brand);
  font-size: 26px; font-weight: 800;
  letter-spacing: -.5px; margin: 10px 0 6px;
  line-height: 1.2;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px,1fr));
  gap: 10px;
  margin-top: 16px;
}
.stat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

/* ── Bid sidebar ── */
.bid-sidebar {
  background: #0a1628;
  border: 1px solid #1e3256;
  border-radius: var(--radius-lg);
  padding: 22px;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.bid-sidebar .label { color: #8da4c4; }
.bid-sidebar .small { color: #a0b4cc; }
.bid-sidebar .money.hero { font-size: 40px; }
.end-time { font-size: 16px; font-weight: 700; color: #fff; margin-top: 4px; }
.time-left {
  font-size: 13px; margin-top: 2px;
}
.time-left.ending { color: #ffb347; }
.time-left.live   { color: #5ee897; }
.time-left.closed { color: #8da4c4; }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }

/* ── Bid form card ── */
#bidForm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}
#bidForm h3 {
  font-family: var(--font-brand);
  font-size: 17px; font-weight: 800;
  margin-bottom: 16px;
}
#bidForm .btn { width: 100%; padding: 12px; font-size: 15px; border-radius: var(--radius); }

/* ── Closed auction notice ── */
.winner-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-top: 16px;
  border-top: 3px solid var(--gold);
}
.winner-panel h3 {
  font-family: var(--font-brand);
  font-size: 17px; font-weight: 800;
  margin-bottom: 8px;
}

/* ── Home feature cards ── */
.feature-section { padding: 56px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 20px; margin-top: 32px; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.feature-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feature-icon {
  width: 44px; height: 44px;
  background: var(--blue-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 14px;
}
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p  { font-size: 14px; color: var(--text-2); line-height: 1.55; }

/* ── Stats bar (home) ── */
.stats-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px;
}
.stats-bar-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 20px;
  display: flex; gap: 40px; flex-wrap: wrap; justify-content: center;
}
.stat-item { text-align: center; }
.stat-item .num { font-family: var(--font-brand); font-size: 26px; font-weight: 800; color: var(--blue); }
.stat-item .desc { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; margin-top: 2px; }

/* ── Empty state ── */
.empty {
  text-align: center; padding: 48px 24px;
  grid-column: 1 / -1;
}
.empty h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }

/* ── Footer ── */
.footer {
  background: #111;
  color: #999;
  text-align: center;
  padding: 24px;
  font-size: 13px;
  margin-top: 48px;
  border-top: 1px solid #222;
}
.footer a { color: #bbb !important; }
.footer a:hover { color: #fff !important; }

/* ── Divider ── */
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Section spacing ── */
.section { padding: 28px 0; }

/* ── Hide on small ── */
@media (max-width: 640px) { .hide-sm { display: none; } }

/* ── Responsive ── */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .actions-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .nav { padding: 0 14px; }
  .hero { padding: 48px 16px 56px; }
  .money.hero { font-size: 30px; }
  .auction-hero-panel .image-box { height: 260px; }
}
