:root {
  --card-min-height: 400px;
  --card-image-height: 200px;
  --card-image-aspect-ratio: 3/2;
}

/* ========== Showroom Header ========== */
.showroom-header {
  text-align: center;
  padding: 3rem 1rem 2rem;
  background-color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
}

.showroom-header h1 {
  color: var(--color-primary);
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.showroom-header p {
  color: #666;
  font-size: 1.1rem;
}

/* ========== Filters Section ========== */
.showroom-filters {
  background-color: #fff;
  padding: 1rem 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  min-height: 120px;
}

.showroom-filters .form-select,
.showroom-filters .form-control {
  border-radius: var(--btn-radius);
  border: 1px solid var(--color-border);
  min-height: 44px;
}

/* ========== View Toggle ========== */
.view-toggle {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

.view-toggle .active {
  background-color: #0d6efd;
  color: white;
}

/* ========== Grid Layout ========== */
.showroom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1rem;
  background-color: var(--color-background);
}

/* ========== List Layout ========== */
.showroom-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* ========== Showroom Card ========== */
.showroom-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: var(--card-min-height);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  contain: layout;
}

.showroom-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.showroom-card picture,
.showroom-list .showroom-card picture {
  display: block;
  background-color: #f5f5f5;
  overflow: hidden;
  position: relative;
}

.showroom-card picture {
  width: 100%;
  height: var(--card-image-height);
}

.showroom-card picture img,
.showroom-list .showroom-card picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background-color: #fff;
}

/* ========== List Mode Specific ========== */
.showroom-list .showroom-card {
  flex-direction: row;
  height: auto;
  min-height: unset;
}

.showroom-list .showroom-card picture {
  width: 250px;
  height: var(--card-image-height);
  flex-shrink: 0;
}

.showroom-list .showroom-card-body {
  flex: 1;
  padding: 15px;
}

/* ========== Card Body & Footer ========== */
.showroom-card-body {
  padding: 1rem;
  flex-grow: 1;
}

.showroom-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.showroom-card-text {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1rem;
}

.showroom-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-top: 1px solid var(--color-border);
}

.showroom-card-footer .btn {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

/* ========== Meta Info ========== */
.showroom-meta {
  font-size: 0.85rem;
  color: #777;
}

/* ========== Motor Type Badges ========== */
.motor-type-badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  padding: 4px 10px;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  z-index: 10;
  text-transform: uppercase;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.motor-electric { background-color: #28a745; }
.motor-diesel  { background-color: #6c757d; }
.motor-gas     { background-color: #fd7e14; }
.motor-petrol  { background-color: #dc3545; }
.motor-dual    { background-color: #ffc107; color: #000; }

/* ========== Corner Ribbon ========== */
.ribbon-diagonal {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 160px;
  height: 160px;
  overflow: visible;
  pointer-events: none;
  z-index: 10;
}

.ribbon-diagonal span {
  position: absolute;
  bottom: 100px;
  right: -55px;
  width: 220px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--color-secondary);
  background-color: var(--color-primary);
  padding: 0.6rem 0;
  transform: rotate(-45deg);
  transform-origin: bottom right;
  text-transform: uppercase;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  line-height: 1;
}

.ribbon-diagonal-rent span {
  background-color: var(--color-secondary);
  color: var(--color-primary);
}

[dir="rtl"] .ribbon-diagonal {
  left: 0;
  right: auto;
}

[dir="rtl"] .ribbon-diagonal span {
  left: -55px;
  right: auto;
  transform: rotate(45deg);
  transform-origin: bottom left;
}

/* ========== Image Placeholder ========== */
.image-placeholder {
  width: 100%;
  height: var(--card-image-height);
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  aspect-ratio: var(--card-image-aspect-ratio);
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== Select2 Styling ========== */
.select2-option-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: inline-block;
  margin-inline-end: 8px;
  vertical-align: middle;
}

.select2-container--default .select2-selection--single {
  height: 44px !important;
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  background-color: #fff !important;
  color: #212529;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.5 !important;
  font-size: 1rem;
  color: #212529;
  padding-left: 0;
  padding-right: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 44px !important;
  top: 0 !important;
  right: 0.5rem;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
  right: auto;
  left: 0.5rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #999 transparent transparent transparent;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #6ab4e3;
  color: #414042;
}

/* ========== Empty State Button ========== */
.empty-state .btn-outline-primary {
  border-color: var(--color-primary, #0d6efd) !important;
  color: var(--color-primary, #0d6efd) !important;
  background-color: transparent !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ========== Pagination ========== */
.pagination-container {
  min-height: 50px;
}

/* ========== Category Banner ========== */
.category-banner-container {
    width: 100%;
    margin: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Remove border-radius for header fitting */
}

.category-banner {
    position: relative;
    height: 400px; /* Increased height for header */
    overflow: hidden;
    /* Full width header styling */
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.category-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* Stronger center focus */
    transition: transform 0.5s ease;
}

.category-banner:hover img {
    transform: scale(1.03);
}


#popupAdContent {
  max-height: 80vh;
  overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .category-banner-overlay {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 992px) {
    .category-banner {
        height: 350px;
    }
    
    .category-banner-overlay h2 {
        font-size: 2.25rem;
    }
    
    .category-banner-overlay p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .category-banner {
        height: 300px;
    }
    
    .category-banner-overlay {
        padding: 1.5rem;
    }
    
    .category-banner-overlay h2 {
        font-size: 2rem;
    }
    
    .category-banner-overlay p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .category-banner {
        height: 250px;
    }
    
    .category-banner-overlay {
        padding: 1.25rem 1rem;
    }
    
    .category-banner-overlay h2 {
        font-size: 1.75rem;
    }
    
    .category-banner-overlay p {
        font-size: 0.9rem;
    }
}
/* ========== Responsive ========== */
@media (max-width: 768px) {
  :root {
    --card-min-height: 350px;
  }

  .showroom-list .showroom-card {
    flex-direction: column;
  }

  .showroom-list .showroom-card picture {
    width: 100%;
    height: var(--card-image-height);
  }
}

@media (max-width: 767.98px) {
  .showroom-card-footer .showroom-learn-more {
    display: inline-block !important;
    width: auto !important;
    max-width: none !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.875rem !important;
    white-space: nowrap;
  }
}

@media (max-width: 576px) {
  .showroom-header h1 {
    font-size: 1.75rem;
  }

  .showroom-grid {
    grid-template-columns: 1fr;
    padding: 1rem 0.5rem;
  }
}