:root {
  --primary: #df6a00;
  --primary-dark: #882800;
  --primary-light: #ff9e10;
  --accent: #0066ff;
  --button: #ffcd23;
}

body { background: #f0f0f0; }

/* pairs with initImageProtection() in app.js - blocks the iOS long-press
   "save image" callout too, and stops the image being drag-selected */
img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.navbar {
  background: linear-gradient(90deg, var(--primary) 10%, var(--primary-light) 100%) !important;
}
.navbar-brand { color: #fff !important; font-weight: bold; }

@media (max-width: 576px) {
  .nav-menu-btn {
    font-size: 11px;
    padding: 0.25rem 0.4rem;
  }
}

.btn-primary,
#bbBrand:focus ~ .btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-warning {
  background-color: var(--button);
  border-color: var(--button);
  color: #333;
}
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-secondary,
.btn-outline-danger {
  background-color: #fff;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  background-color: #fff3e6 !important;
  border-color: var(--primary) !important;
  color: var(--primary-dark) !important;
}

a { color: var(--primary-dark); }
a:hover { color: var(--primary); }

.badge-danger { background-color: var(--primary); }
.text-danger { color: var(--primary) !important; }
.table-warning { background-color: rgba(255, 205, 35, 0.35); }

.brand-grid,
.tight-grid {
  margin-left: -4px;
  margin-right: -4px;
}
.brand-grid > div,
.tight-grid > div {
  padding-left: 4px;
  padding-right: 4px;
  margin-bottom: 8px;
}

.brand-tile {
  color: #333;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  padding: 8px 4px;
}
.brand-tile:hover {
  text-decoration: none;
  color: var(--primary);
  background-color: #fff3e6;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.brand-tile img {
  width: 100%;
  height: 56px;
  object-fit: contain;
}
.brand-tile .brand-name {
  height: 2.4em;
  line-height: 1.2em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.model-thumb {
  width: 110px;
  height: 80px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px 0 0 4px;
}

.car-photo {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #fff;
}

.installment-photo {
  width: 100%;
  height: 90px;
  object-fit: contain;
  background: #fff;
}

.card,
.list-group-item {
  background-color: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
}
.card.flex-row:hover,
.card.flex-row:hover .card-body,
.card.flex-row:hover .card-body * {
  background-color: #fff3e6;
  color: var(--primary-dark) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.list-group-item + .list-group-item { margin-top: 6px; }

/* search dropdown: rows sit flush together inside one shadowed panel */
#carSearchResults.list-group { border: none; }
#carSearchResults .list-group-item {
  border-left: none;
  border-right: none;
  border-radius: 0 !important;
}
#carSearchResults .list-group-item + .list-group-item {
  margin-top: 0;
  border-top: none;
}
.search-result-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}

.list-group-item:hover,
.list-group-item-action:hover,
.list-group-item-action:hover *,
#carSearchResults .list-group-item:hover {
  background-color: #fff3e6;
  color: var(--primary-dark) !important;
}

/* compare page: cards shrink to fit first; only scroll (visible scrollbar at
   the bottom) once they hit the minimum readable width */
.compare-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.compare-card {
  flex: 1 1 0;
  min-width: 150px;
  max-width: 220px;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  padding: 10px;
  position: relative;
}
.compare-card img {
  width: 100%;
  height: clamp(70px, 25vw, 120px);
  object-fit: contain;
  background: #fff;
  margin-bottom: 6px;
}
.compare-card .brand { color: #888; font-size: 13px; }
.compare-card .model { font-weight: bold; font-size: 17px; }
.compare-card .gen { color: #888; font-size: 13px; margin-bottom: 4px; }
.compare-card .year { color: var(--primary); font-weight: bold; margin-bottom: 6px; }
.compare-card dl { margin-bottom: 0; }
.compare-card dt { font-size: 12px; color: #888; font-weight: normal; margin-top: 6px; }
.compare-card dd { font-size: 15px; font-weight: bold; margin-bottom: 0; }
.compare-card dd.price { color: var(--primary); }
.compare-card .remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: rgba(0,0,0,.5);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  line-height: 1;
  font-size: 14px;
}

/* installment table on gen.php: 5 columns is tight on small screens */
@media (max-width: 576px) {
  #dfTable { font-size: 11px; }
  #dfTable th, #dfTable td { padding: 0.3rem 0.2rem; }
  #dfTable .df-rate { max-width: 55px !important; font-size: 11px; padding: 0.2rem; }
}
