/* ═══════════════════════════════════════════════
   28KART — Custom Stylesheet
   Racing theme: #1a1a2e header, #E63329 accent
   ═══════════════════════════════════════════════ */

:root {
  --kart-dark:    #1a1a2e;
  --kart-darker:  #0f0f1e;
  --kart-red:     #E63329;
  --kart-red-hover: #c0281f;
  --kart-gold:    #f5a623;
  --kart-light:   #f8f9fa;
  --kart-border:  #e0e0e0;
}

/* ── Body ───────────────────────────────────── */
body {
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  background: #f4f6f9;
  color: #222;
}

/* ── Header / Nav ───────────────────────────── */
.site-header {
  background: var(--kart-dark) !important;
  border-bottom: 3px solid var(--kart-red);
  padding: 0.5rem 0;
}

.brand-logo {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -1px;
  text-decoration: none;
}
.brand-28   { color: var(--kart-red); }
.brand-kart { color: #fff; }

.search-input {
  border-radius: 4px 0 0 4px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  padding-left: 1rem;
}
.search-input::placeholder { color: rgba(255,255,255,0.5); }
.search-input:focus {
  background: rgba(255,255,255,0.2);
  color: #fff;
  outline: none;
  box-shadow: none;
}

/* ── Hero ───────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--kart-darker) 0%, var(--kart-dark) 60%, #2a1a2e 100%);
  padding: 3.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -30px; right: -60px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(230,51,41,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tagline {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
}
.hero-tagline span { color: var(--kart-red); }
.hero-sub { color: rgba(255,255,255,0.7); font-size: 1rem; }

/* ── Section headings ───────────────────────── */
.section-title {
  font-weight: 800;
  font-size: 1.2rem;
  border-left: 4px solid var(--kart-red);
  padding-left: 0.75rem;
  margin-bottom: 1.25rem;
  color: var(--kart-dark);
}

/* ── Category nav cards ─────────────────────── */
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--kart-border);
  border-radius: 12px;
  padding: 1.25rem 0.5rem;
  text-decoration: none;
  color: var(--kart-dark);
  transition: all .2s;
  text-align: center;
  min-height: 90px;
}
.cat-card:hover, .cat-card:focus {
  border-color: var(--kart-red);
  box-shadow: 0 4px 16px rgba(230,51,41,0.15);
  color: var(--kart-red);
  text-decoration: none;
}
.cat-card i { font-size: 1.8rem; margin-bottom: .4rem; }
.cat-card span { font-size: .85rem; font-weight: 600; }

/* ── Listing Card ───────────────────────────── */
.listing-card {
  background: #fff;
  border: 1px solid var(--kart-border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.listing-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}
.listing-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #eee;
}
.listing-card-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 3rem;
}
.listing-card-body {
  padding: 0.85rem 1rem 0.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.listing-card-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--kart-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}
.listing-card-title:hover { color: var(--kart-red); }
.listing-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--kart-red);
}
.listing-meta {
  font-size: .78rem;
  color: #888;
  margin-top: auto;
}
.listing-card-footer {
  padding: .6rem 1rem;
  border-top: 1px solid var(--kart-border);
  background: #fafafa;
}
.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .8rem;
  padding: .3rem .8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: background .2s;
  text-decoration: none;
}
.btn-whatsapp:hover { background: #1da851; color: #fff; }
.badge-featured {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--kart-gold);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: 4px;
}

/* ── Listing Detail ─────────────────────────── */
.listing-gallery .main-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 10px;
  background: #f0f0f0;
}
.gallery-thumbs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.gallery-thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border .15s;
}
.gallery-thumb.active, .gallery-thumb:hover {
  border-color: var(--kart-red);
}
.spec-table td:first-child {
  width: 35%;
  font-weight: 600;
  color: #555;
  background: #f8f8f8;
}
.seller-card {
  background: #fff;
  border: 1px solid var(--kart-border);
  border-radius: 10px;
  padding: 1.25rem;
}
.seller-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--kart-border);
}

/* ── Forms ──────────────────────────────────── */
.form-card {
  background: #fff;
  border: 1px solid var(--kart-border);
  border-radius: 12px;
  padding: 2rem;
}
.form-label { font-weight: 600; font-size: .9rem; }
.btn-kart-primary {
  background: var(--kart-red);
  color: #fff;
  border: none;
  font-weight: 700;
  padding: .55rem 1.5rem;
  border-radius: 6px;
  transition: background .2s;
}
.btn-kart-primary:hover { background: var(--kart-red-hover); color: #fff; }

/* Image upload preview grid */
.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  margin-top: .75rem;
}
.upload-slot {
  aspect-ratio: 1;
  border: 2px dashed var(--kart-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fafafa;
  overflow: hidden;
  position: relative;
}
.upload-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-slot .remove-img {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(230,51,41,.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  display: none;
}
.upload-slot:hover .remove-img { display: flex; }

/* ── Browse/Filters ─────────────────────────── */
.filter-sidebar {
  background: #fff;
  border: 1px solid var(--kart-border);
  border-radius: 10px;
  padding: 1.25rem;
}
.filter-sidebar h6 {
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888;
  margin-bottom: .75rem;
}

/* ── Admin Sidebar ──────────────────────────── */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--kart-darker);
  flex-shrink: 0;
  padding-top: 1rem;
}
.admin-sidebar .sidebar-brand {
  display: block;
  padding: .75rem 1.5rem 1.25rem;
  font-size: 1.3rem;
  font-weight: 900;
  text-decoration: none;
}
.admin-sidebar .nav-link {
  color: rgba(255,255,255,.7);
  padding: .6rem 1.5rem;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  color: #fff;
  border-left-color: var(--kart-red);
  background: rgba(255,255,255,.05);
}
.admin-sidebar .nav-link i { width: 20px; }
.admin-main {
  flex: 1;
  background: #f4f6f9;
  padding: 0;
  overflow-x: auto;
}
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--kart-border);
  padding: .75rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
}
.admin-content { padding: 1.5rem; }
.stat-card {
  background: #fff;
  border: 1px solid var(--kart-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  border-top: 4px solid var(--kart-red);
}
.stat-card h3 { font-size: 2rem; font-weight: 800; }

/* ── Wanted board ───────────────────────────── */
.wanted-card {
  background: #fff;
  border: 1px solid var(--kart-border);
  border-left: 4px solid var(--kart-gold);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: box-shadow .2s;
}
.wanted-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

/* ── Profile ────────────────────────────────── */
.profile-header {
  background: linear-gradient(135deg, var(--kart-dark), var(--kart-darker));
  padding: 2.5rem 0;
  color: #fff;
}
.profile-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.2);
  object-fit: cover;
}

/* ── Dealer page ────────────────────────────── */
.dealer-banner {
  background: linear-gradient(135deg, var(--kart-dark), #2a1040);
  color: #fff;
  padding: 2.5rem 0;
}
.dealer-logo {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.25);
}

/* ── Footer ─────────────────────────────────── */
.site-footer {
  background: #f4f5f7 !important;
  color: #666 !important;
  padding-top: 3rem;
  border-top: 1px solid #e0e0e0;
}
.site-footer a {
  color: #666;
  text-decoration: none;
  transition: color .15s;
}
.site-footer a:hover { color: var(--kart-red); }
.footer-heading {
  color: #444;
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.site-footer .text-muted { color: #888 !important; }
.site-footer hr { border-color: #ddd !important; }

/* ── Utilities ──────────────────────────────── */
.text-kart-red { color: var(--kart-red) !important; }
.bg-kart-dark  { background: var(--kart-dark) !important; }
.border-kart   { border-color: var(--kart-red) !important; }

/* Responsive tweaks */
@media (max-width: 576px) {
  .upload-preview-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-sidebar { width: 100%; min-height: auto; }
  .admin-wrapper { flex-direction: column; }
}
@media (max-width: 767px) {
  .hero-section { padding: 2rem 0; }
}