/* ================================================================
   Impala Auto Spares — Main Stylesheet
   ================================================================ */

:root {
  --brand-red:    #c0392b;
  --brand-dark:   #1a1a2e;
  --brand-light:  #f8f9fa;
  --text-muted:   #6c757d;
  --bs-danger:    #c0392b;
  --bs-danger-rgb: 192, 57, 43;
}

/* ---- Bootstrap bg-danger / btn-danger brand override ---- */
.bg-danger {
  --bs-bg-opacity: 1;
  background-color: #9d8f8d !important;
}
.btn-danger,
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
  background-color: #c0392b !important;
  border-color:     #a93226 !important;
}
.btn-danger:hover {
  background-color: #a93226 !important;
}
.text-danger {
  color: #c0392b !important;
}
.border-danger {
  border-color: #c0392b !important;
}
.navbar-dark.bg-danger {
  background-color: #8198ef !important;
}
.badge.bg-danger {
  background-color: #c0392b !important;
}

/* ---- Base ---- */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f5f6fa;
  color: #2d2d2d;
}

a { color: var(--brand-red); }
a:hover { color: #922b21; }

/* ---- Top bar ---- */
.top-bar { font-size: .8rem; }

/* ---- Hero / Banner ---- */
.hero-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #c0392b 100%);
  color: #fff;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/hero-pattern.svg') center/cover no-repeat;
  opacity: .05;
  pointer-events: none;
}
.hero-section h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; }
.hero-section p   { font-size: 1.1rem; opacity: .9; }

/* ---- Search box ---- */
.search-box-wrap .input-group {
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 6px 30px rgba(0,0,0,.25);
}
.search-box-wrap .form-control {
  border: none;
  padding: .85rem 1.4rem;
  font-size: 1rem;
}
.search-box-wrap .form-control:focus { box-shadow: none; }
.search-box-wrap .btn-search {
  background: var(--brand-red);
  color: #fff;
  border: none;
  padding: .85rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 0 50px 50px 0 !important;
  transition: background .2s;
}
.search-box-wrap .btn-search:hover { background: #922b21; }
.search-type-tabs .btn { border-radius: 20px !important; font-size: .8rem; }

/* ---- Part Cards ---- */
.part-card {
  transition: transform .2s, box-shadow .2s;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.part-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
}
.part-card .card-img-top {
  height: 180px;
  object-fit: contain;
  background: #f9f9f9;
  padding: 10px;
}
.part-card .no-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
  color: #ccc;
  font-size: 3rem;
}
.part-card .card-body { padding: 1rem; }
.part-card .part-number {
  font-size: .75rem;
  color: var(--text-muted);
  font-family: monospace;
}
.part-card .part-title {
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.part-card .price-tag {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-red);
}
.part-card .price-hidden {
  font-size: .85rem;
  color: var(--text-muted);
  font-style: italic;
}
.part-card .btn-inquiry {
  font-size: .82rem;
  padding: .35rem .8rem;
}

/* ---- Cart sidebar / toast ---- */
#cartToast { min-width: 280px; }

/* ---- Quote Cart ---- */
.cart-table th { background: var(--brand-dark); color: #fff; }
.qty-input { width: 65px; text-align: center; }

/* ---- Auth forms ---- */
.auth-card {
  max-width: 480px;
  margin: 50px auto;
  border-radius: 16px;
  box-shadow: 0 6px 30px rgba(0,0,0,.1);
  border: none;
  background: #fff;
}
.auth-card .card-header {
  background: var(--brand-red);
  color: #fff;
  border-radius: 16px 16px 0 0;
  padding: 1.5rem;
  text-align: center;
}
.auth-card .card-header h4 { margin: 0; font-weight: 700; }
.auth-card .card-body { padding: 2rem; }

/* ---- Admin ---- */
.admin-sidebar {
  min-height: 100vh;
  background: var(--brand-dark);
  color: #fff;
  width: 240px;
  position: fixed;
  top: 0; left: 0;
  overflow-y: auto;
  z-index: 1000;
  transition: width .3s;
}
.admin-sidebar .nav-link {
  color: rgba(255,255,255,.7);
  padding: .6rem 1.2rem;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.08);
  border-left-color: var(--brand-red);
}
.admin-sidebar .nav-link i { width: 22px; }
.admin-main { margin-left: 240px; padding: 20px; min-height: 100vh; }
.admin-topbar {
  background: #fff;
  padding: 12px 20px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.stat-card {
  border-radius: 12px;
  border: none;
  overflow: hidden;
}
.stat-card .card-body { padding: 1.25rem; }
.stat-card .stat-num { font-size: 2rem; font-weight: 800; }

/* ---- Badges ---- */
.badge-available   { background: #198754; color: #fff; }
.badge-out         { background: #dc3545; color: #fff; }
.badge-check       { background: #ffc107; color: #333; }

/* ---- VIN Form ---- */
.vin-form-card {
  max-width: 780px;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 6px 30px rgba(0,0,0,.1);
  border: none;
}
.vin-icon { font-size: 2.5rem; color: var(--brand-red); }

/* ---- Loading spinner overlay ---- */
#loadingOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#loadingOverlay.active { display: flex; }

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .admin-sidebar { width: 100%; min-height: auto; position: static; }
  .admin-main    { margin-left: 0; }
}
@media (max-width: 576px) {
  .hero-section  { padding: 50px 0 40px; }
  .hero-section h1 { font-size: 1.6rem; }
}

/* ---- Animations ---- */
.fade-in { animation: fadeIn .4s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Steps section on homepage ---- */
.step-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--brand-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

/* ---- Price reveal lock icon ---- */
.price-lock { color: #aaa; font-size: 1.2rem; }
