:root {
  --clb-primary: #2f5fed;
  --clb-primary-dark: #1d3fc4;
  --clb-primary-light: #eef2ff;
  --clb-offer: #0f9d63;
  --clb-offer-light: #e6f7ee;
  --clb-request: #e0435b;
  --clb-request-light: #fdeaee;
  --clb-ink: #131a2c;
  --clb-muted: #667085;
  --clb-bg: #f5f7fb;
  --clb-surface: #ffffff;
  --clb-border: #e6e9f2;
  --clb-radius-lg: 18px;
  --clb-radius: 14px;
  --clb-radius-sm: 10px;
  --clb-shadow-sm: 0 1px 3px rgba(19, 26, 44, .06);
  --clb-shadow: 0 6px 20px rgba(19, 26, 44, .08);
  --clb-shadow-hover: 0 14px 32px rgba(19, 26, 44, .14);
}

html {
  scroll-behavior: smooth;
}

body {
  padding-bottom: 0;
  font-size: 1rem;
  background: var(--clb-bg);
  color: var(--clb-ink);
  font-family: "Cairo", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .fw-bold {
  font-weight: 700 !important;
  letter-spacing: -.01em;
}

a {
  color: var(--clb-primary);
}

/* ============ Navbar ============ */
.navbar {
  backdrop-filter: saturate(180%) blur(8px);
  background-color: rgba(255, 255, 255, .92) !important;
}
.navbar-brand {
  font-weight: 800 !important;
  letter-spacing: -.02em;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.navbar-brand .bi {
  font-size: 1.15em;
  color: var(--clb-primary);
}

/* ============ Buttons ============ */
.btn {
  min-height: 2.75rem;
  border-radius: var(--clb-radius-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease, filter .15s ease;
}
.btn:active {
  transform: scale(.97);
}
.btn-lg {
  min-height: 3.25rem;
  border-radius: var(--clb-radius);
  font-size: 1.02rem;
}
.btn-sm {
  min-height: 2.25rem;
  border-radius: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--clb-primary), var(--clb-primary-dark));
  border: none;
  box-shadow: 0 6px 16px rgba(47, 95, 237, .28);
}
.btn-primary:hover, .btn-primary:focus {
  filter: brightness(1.06);
  box-shadow: 0 8px 20px rgba(47, 95, 237, .34);
}
/* A big soft shadow reads fine on a large CTA but makes a small nav-bar
   button look puffier/taller than its neighbors, so keep it tight here. */
.btn-sm.btn-primary {
  box-shadow: 0 2px 6px rgba(47, 95, 237, .25);
}
.btn-sm.btn-primary:hover, .btn-sm.btn-primary:focus {
  box-shadow: 0 3px 8px rgba(47, 95, 237, .3);
}
.btn-outline-secondary {
  border-color: var(--clb-border);
  color: var(--clb-ink);
}
.btn-outline-secondary:hover {
  background: var(--clb-bg);
  color: var(--clb-ink);
  border-color: var(--clb-border);
}
.btn-success { background-color: var(--clb-offer); border-color: var(--clb-offer); }
.btn-outline-success { color: var(--clb-offer); border-color: var(--clb-offer); }
.btn-outline-success:hover { background-color: var(--clb-offer); border-color: var(--clb-offer); }
.btn-danger, .btn-outline-danger:hover { background-color: var(--clb-request); border-color: var(--clb-request); }
.btn-outline-danger { color: var(--clb-request); border-color: var(--clb-request); }

/* ============ Forms ============ */
.form-control, .form-select {
  min-height: 3rem;
  font-size: 1rem;
  border-radius: var(--clb-radius-sm);
  border-color: var(--clb-border);
}
.form-control:focus, .form-select:focus {
  border-color: var(--clb-primary);
  box-shadow: 0 0 0 .2rem rgba(47, 95, 237, .15);
}
.form-control-lg, .form-select-lg {
  min-height: 3.5rem;
  border-radius: var(--clb-radius);
}
.form-label {
  font-weight: 600;
}
.form-check-input:checked {
  background-color: var(--clb-primary);
  border-color: var(--clb-primary);
}

.step-indicator {
  display: flex;
  gap: .35rem;
  margin-bottom: 1.25rem;
}
.step-indicator .step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--clb-border);
}
.step-indicator .step.active,
.step-indicator .step.done {
  background: var(--clb-primary);
}

/* ============ Cards ============ */
.card {
  border: 1px solid var(--clb-border);
  border-radius: var(--clb-radius);
  box-shadow: var(--clb-shadow-sm);
}

.listing-card {
  transition: transform .18s ease, box-shadow .18s ease;
  border-radius: var(--clb-radius);
  overflow: hidden;
  height: 230px;
}
.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--clb-shadow-hover);
}
.listing-card .card-body {
  padding: 1.1rem;
}
/* Clamp to 2 lines and reserve that space even for a short title, so a
   long ad title never grows the card past the fixed height above — every
   card in the grid stays the same size no matter how much text it has. */
.listing-card .listing-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.35;
  min-height: calc(1.35em * 2);
}
.listing-card .listing-route {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--clb-muted);
  font-size: .85rem;
}
.listing-card .listing-route .bi {
  color: var(--clb-primary);
}
.listing-card .listing-meta {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: var(--clb-muted);
}

.car-thumb {
  width: 100%;
  max-width: 64px;
  height: auto;
  object-fit: contain;
}

/* The homepage scroll-strip still shows narrow, peeking cards on phones
   (grid pages don't — they're one full-width card per row there now), so
   tighten padding/type/thumb only for that context or text looks cramped. */
@media (max-width: 575.98px) {
  .scroll-strip .listing-card {
    height: 190px;
  }
  .scroll-strip .listing-card .card-body {
    padding: .75rem;
  }
  .scroll-strip .listing-card .listing-title {
    font-size: .92rem;
    line-height: 1.3;
    min-height: calc(1.3em * 2);
  }
  .scroll-strip .listing-card .listing-route,
  .scroll-strip .listing-card .listing-meta {
    font-size: .74rem;
  }
  .scroll-strip .listing-card .badge {
    font-size: .68rem;
    padding: .3em .55em;
  }
  .scroll-strip .listing-card .car-thumb {
    max-width: 40px;
  }
}

/* Listing detail page: prominent route line under the title */
.route-display {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  color: var(--clb-ink);
}
.route-display .bi-geo-alt-fill,
.route-display .bi-arrow-left,
.route-display .bi-arrow-right {
  color: var(--clb-primary);
}

/* Listing detail page: vehicle showcase image */
.vehicle-showcase {
  background: var(--clb-primary-light);
  border-color: transparent;
}
.vehicle-showcase-img {
  width: 160px;
  height: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Listing type badges */
.badge-offer {
  background-color: var(--clb-offer-light);
  color: var(--clb-offer);
  font-weight: 700;
}
.badge-request {
  background-color: var(--clb-request-light);
  color: var(--clb-request);
  font-weight: 700;
}
.badge {
  border-radius: 999px;
  padding: .4em .75em;
  font-weight: 700;
}

/* ============ Stat cards ============ */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}
.stat-card {
  background: var(--clb-surface);
  border: 1px solid var(--clb-border);
  border-radius: var(--clb-radius);
  padding: 1rem .75rem;
  text-align: center;
  box-shadow: var(--clb-shadow-sm);
}
.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--clb-primary-light);
  color: var(--clb-primary);
  font-size: 1.15rem;
  margin-bottom: .5rem;
}
.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}
.stat-card .stat-label {
  font-size: .78rem;
  color: var(--clb-muted);
  font-weight: 600;
}
@media (min-width: 576px) {
  .stat-card .stat-value { font-size: 1.75rem; }
}

/* ============ Horizontal scroll strip (listing carousels) ============ */
.scroll-strip {
  display: flex;
  gap: .9rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: .25rem .1rem 1rem;
  margin: 0 -.1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll-strip::-webkit-scrollbar {
  display: none;
}
.scroll-strip .scroll-item {
  flex: 0 0 auto;
  width: 78%;
  max-width: 340px;
  scroll-snap-align: start;
}
@media (min-width: 576px) {
  .scroll-strip .scroll-item { width: 46%; max-width: 380px; }
}
@media (min-width: 992px) {
  .scroll-strip .scroll-item { width: 32%; max-width: 420px; }
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .9rem;
}
.section-heading h2 {
  font-size: 1.3rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-heading h2 .bi {
  color: var(--clb-primary);
}
.section-heading a {
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

/* ============ Hero ============ */
.hero-section {
  background: linear-gradient(135deg, var(--clb-primary) 0%, var(--clb-primary-dark) 100%);
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.12), transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(255,255,255,.10), transparent 40%);
  pointer-events: none;
}
.hero-section .container {
  position: relative;
}

/* Homepage quick-search box: floats up over the hero's bottom edge */
.search-box {
  margin-top: -2.25rem;
  position: relative;
  z-index: 2;
  box-shadow: var(--clb-shadow-hover);
  border: none;
}
.search-box .form-select {
  min-height: 3rem;
}

/* ============ Empty state ============ */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--clb-muted);
}
.empty-state .empty-state-icon {
  font-size: 2.25rem;
  color: var(--clb-border);
  margin-bottom: .5rem;
  display: block;
}

/* ============ Mobile bottom navigation ============ */
.bottom-nav {
  padding-top: .3rem;
  padding-bottom: .3rem;
  background: rgba(255, 255, 255, .94) !important;
  backdrop-filter: saturate(180%) blur(10px);
  box-shadow: 0 -4px 20px rgba(19, 26, 44, .08);
  z-index: 1030;
  border-top: 1px solid var(--clb-border) !important;
}
.bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  font-size: .66rem;
  font-weight: 600;
  color: var(--clb-muted);
  text-decoration: none;
  line-height: 1.2;
  padding: .35rem 0;
  border-radius: 999px;
  transition: color .15s ease;
}
.bottom-nav-link .bi {
  font-size: 1.3rem;
  line-height: 1;
}
.bottom-nav-link.active {
  color: var(--clb-primary);
}
.bottom-nav-cta .bottom-nav-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--clb-primary), var(--clb-primary-dark));
  color: #fff;
  margin-top: -1.1rem;
  box-shadow: 0 6px 16px rgba(47, 95, 237, .4);
}
.bottom-nav-cta .bottom-nav-icon-wrap .bi {
  font-size: 1.35rem;
}
.bottom-nav-cta {
  color: var(--clb-primary);
}

body:has(.bottom-nav) {
  padding-bottom: 4.5rem;
}

@media (min-width: 992px) {
  body:has(.bottom-nav) {
    padding-bottom: 0;
  }
}

/* ============ Footer ============ */
.site-footer {
  background: #0f1526;
}
.site-footer a {
  color: #b9c2d8;
}
.site-footer a:hover {
  color: #fff;
}
.site-footer h5, .site-footer h6 {
  color: #fff;
}
.footer-seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.footer-seo-links a {
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: .4rem .9rem;
  font-size: .82rem;
  text-decoration: none;
  font-weight: 600;
}
.footer-seo-links a:hover {
  background: rgba(255,255,255,.14);
}

[dir="rtl"] .navbar-toggler-icon {
  transform: scaleX(-1);
}
