/* ==========================================================================
   ACRB FLEET ARCHIVE (SCOPED COMPONENT - NO :ROOT, NO GRADIENTS)
   Location: assets/css/frontend/all-cars.css
   ========================================================================== */

/* Scoped Token Fallbacks & Base Typography */
.acrb-grid-wrapper,
.acrb-empty {
  --acrb-grid-primary: #4f46e5;
  --acrb-grid-secondary: #64748b;
  --acrb-grid-text: #0f172a;
  --acrb-grid-accent: #059669;
  --acrb-grid-btn-bg: #4f46e5;
  --acrb-grid-btn-hover: #4338ca;
  --acrb-grid-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  font-family: var(--acrb-grid-font, sans-serif);
  color: var(--acrb-grid-text, #0f172a);
  box-sizing: border-box;
}

.acrb-grid-wrapper *,
.acrb-grid-wrapper *::before,
.acrb-grid-wrapper *::after,
.acrb-empty *,
.acrb-empty *::before,
.acrb-empty *::after {
  box-sizing: inherit;
}

/* Empty State */
.acrb-empty {
  text-align: center;
  padding: 60px 20px;
  font-size: 14.5px;
  color: var(--acrb-grid-secondary, #64748b);
}

/* Wrapper Layout */
.acrb-grid-wrapper {
  padding: 30px 0;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  background: transparent;
}

.acrb-layout-container {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  position: relative;
}

/* Universal SVG Icon Standardization */
.acrb-grid-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Mobile Collapsible Header Bar
   -------------------------------------------------------------------------- */
.acrb-mobile-filter-bar {
  display: none;
  width: 100%;
  margin-bottom: 20px;
}

.acrb-mobile-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  font-family: inherit;
}

.acrb-mobile-toggle-btn:hover {
  border-color: var(--acrb-grid-primary, #4f46e5);
}

/* --------------------------------------------------------------------------
   Filter Sidebar
   -------------------------------------------------------------------------- */
.acrb-filter-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 10px 35px -10px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  position: sticky;
  top: 24px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.acrb-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid #f1f5f9;
}

.acrb-sidebar-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.acrb-sidebar-title-group svg {
  color: var(--acrb-grid-primary, #4f46e5);
  flex-shrink: 0;
}

.acrb-sidebar-title-group h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

button.acrb-btn-clear {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
}

button.acrb-btn-clear:hover {
  color: var(--acrb-grid-primary, #4f46e5);
  background: #f1f5f9;
}

.acrb-filter-section {
  margin-bottom: 24px;
}

.acrb-filter-section:last-child {
  margin-bottom: 0;
}

.acrb-filter-label,
.acrb-filter-subheading {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #475569;
  margin-bottom: 12px;
}

.acrb-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.acrb-search-box svg {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.acrb-search-box input {
  width: 100% !important;
  height: 44px !important;
  padding: 8px 14px 8px 42px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  font-size: 0.9rem !important;
  background: #f8fafc !important;
  color: var(--acrb-grid-text, #0f172a) !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit !important;
}

.acrb-search-box input:focus {
  background: #ffffff !important;
  border-color: var(--acrb-grid-primary, #4f46e5) !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1) !important;
}

/* Budget Slider */
.acrb-price-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.acrb-price-badge {
  background: #eef2ff;
  color: var(--acrb-grid-primary, #4f46e5);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 10px;
  border: 1px solid #e0e7ff;
}

.acrb-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  outline: none;
  margin: 10px 0 6px 0;
  cursor: pointer;
}

.acrb-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--acrb-grid-primary, #4f46e5);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.acrb-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.acrb-slider-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Category Item List */
.acrb-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.acrb-filter-item label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.acrb-filter-item label:hover {
  background: #f8fafc;
}

.acrb-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

.acrb-custom-check {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.acrb-custom-check svg {
  display: none;
  color: #ffffff;
}

.acrb-cat-filter {
  display: none;
}

.acrb-cat-filter:checked + .acrb-custom-check {
  background: var(--acrb-grid-primary, #4f46e5);
  border-color: var(--acrb-grid-primary, #4f46e5);
}

.acrb-cat-filter:checked + .acrb-custom-check svg {
  display: block;
}

.acrb-cat-filter:checked ~ span {
  font-weight: 700;
  color: #0f172a;
}

.acrb-count-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 8px;
}

/* Segmented Button Chips for Specs */
.acrb-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.acrb-chip-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.acrb-chip-btn input {
  display: none;
}

.acrb-chip-btn svg {
  color: #94a3b8;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.acrb-chip-btn:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.acrb-chip-btn:has(input:checked) {
  background: #eef2ff;
  border-color: var(--acrb-grid-primary, #4f46e5);
  color: var(--acrb-grid-primary, #4f46e5);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

.acrb-chip-btn:has(input:checked) svg {
  color: var(--acrb-grid-primary, #4f46e5);
}

/* --------------------------------------------------------------------------
   Right Content Container & Top Toolbar
   -------------------------------------------------------------------------- */
.acrb-right-content {
  flex: 1;
  width: 100%;
  min-width: 0;
}

.acrb-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.03);
  gap: 16px;
  flex-wrap: wrap;
}

.acrb-result-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.acrb-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Per-Page & Sort Dropdowns */
.acrb-select-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.acrb-select-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.acrb-select-field {
  height: 38px;
  padding: 0 32px 0 12px;
  background: #f8fafc url('data:image/svg+xml;utf8,<svg fill="none" stroke="%2364748b" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7"></path></svg>') no-repeat right 10px center;
  background-size: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  appearance: none;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.acrb-select-field:focus {
  border-color: var(--acrb-grid-primary, #4f46e5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* View Mode Buttons */
.acrb-view-toolbar {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}

button.acrb-view-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

button.acrb-view-btn:hover {
  color: #0f172a;
}

button.acrb-view-btn.active {
  background: #ffffff;
  color: var(--acrb-grid-primary, #4f46e5);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* --------------------------------------------------------------------------
   Vehicle Cards (Grid & List Layouts)
   -------------------------------------------------------------------------- */
.acrb-car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.acrb-car-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.acrb-car-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 18px 38px -12px rgba(15, 23, 42, 0.12);
}

.acrb-img-container {
  position: relative;
  width: 100%;
  height: 200px;
  background: #f8fafc;
  overflow: hidden;
}

.acrb-img-container a {
  display: block;
  width: 100%;
  height: 100%;
}

.acrb-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.acrb-car-card:hover .acrb-img-container img {
  transform: scale(1.05);
}

.acrb-no-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: #f1f5f9;
}

.acrb-badge-cat {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  z-index: 2;
}

.acrb-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
  gap: 16px;
}

.acrb-card-title {
  margin: 0 0 14px 0;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.35;
}

.acrb-card-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.15s ease;
}

.acrb-card-title a:hover {
  color: var(--acrb-grid-primary, #4f46e5);
}

.acrb-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  padding: 12px;
  border-radius: 14px;
}

.acrb-spec-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.acrb-spec-item svg {
  color: var(--acrb-grid-primary, #4f46e5);
  flex-shrink: 0;
}

.acrb-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.acrb-price-block {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.acrb-price-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.acrb-price-unit {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.acrb-btn-book {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--acrb-grid-btn-bg, #4f46e5);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.22);
}

.acrb-btn-book:hover {
  background: var(--acrb-grid-btn-hover, #4338ca);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.32);
  color: #ffffff;
}

/* List View Mode Styling */
.acrb-car-grid.list-view {
  grid-template-columns: 1fr;
}

.acrb-car-grid.list-view .acrb-car-card {
  flex-direction: row;
}

.acrb-car-grid.list-view .acrb-img-container {
  width: 320px;
  height: auto;
  flex-shrink: 0;
}

.acrb-car-grid.list-view .acrb-card-body {
  padding: 24px;
}

/* --------------------------------------------------------------------------
   Numbered Pagination Controls
   -------------------------------------------------------------------------- */
.acrb-pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  user-select: none;
}

.acrb-page-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
  font-family: inherit;
}

.acrb-page-btn:hover:not(:disabled) {
  border-color: var(--acrb-grid-primary, #4f46e5);
  color: var(--acrb-grid-primary, #4f46e5);
  background: #f8fafc;
  transform: translateY(-1px);
}

.acrb-page-btn.active {
  background: var(--acrb-grid-primary, #4f46e5);
  border-color: var(--acrb-grid-primary, #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.acrb-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.acrb-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 42px;
  font-size: 1rem;
  font-weight: 800;
  color: #94a3b8;
}

/* Empty State */
.acrb-no-cars-msg {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  grid-column: 1 / -1;
}

.acrb-no-cars-icon {
  margin: 0 auto 16px auto;
  color: #94a3b8;
  display: block;
}

.acrb-no-cars-title {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.acrb-no-cars-desc {
  margin: 0 0 20px 0;
  color: #64748b;
  font-size: 0.95rem;
}

.acrb-btn-clear-empty {
  padding: 10px 22px;
  background: var(--acrb-grid-primary, #4f46e5);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .acrb-layout-container {
    flex-direction: column;
  }
  .acrb-mobile-filter-bar {
    display: block;
  }
  .acrb-filter-sidebar {
    width: 100%;
    position: static;
    display: none;
    margin-bottom: 24px;
  }
  .acrb-filter-sidebar.is-open {
    display: block;
  }
  .acrb-car-grid.list-view .acrb-car-card {
    flex-direction: column;
  }
  .acrb-car-grid.list-view .acrb-img-container {
    width: 100%;
    height: 200px;
  }
}