/* ═══════════════════════════════════════════════════════════
   Wizmoto — Global Responsive & Sizing Fixes
   Applied to all templates via base.html
   ═══════════════════════════════════════════════════════════ */

/* ── Base Container Padding ──────────────────────────────── */
.boxcar-container {
  padding: 0 24px;
}
@media (max-width: 768px) {
  .boxcar-container {
    padding: 0 16px;
  }
}

/* ── Header ──────────────────────────────────────────────── */
.boxcar-header .header-inner {
  padding: 8px 0;
}
.boxcar-header .c-box {
  padding-top: 8px;
  padding-bottom: 8px;
  min-height: 60px;
}
.boxcar-header .logo img {
  max-height: 36px;
  width: auto;
}
.boxcar-header .navigation > li > a {
  font-size: 14px !important;
  font-weight: 500 !important;
  padding: 8px 14px !important;
}
@media (max-width: 1200px) {
  .boxcar-header .navigation > li > a {
    padding: 8px 10px !important;
    font-size: 13px !important;
  }
}

/* ── Inner pages top spacing (accounts for fixed header) ── */
.inner-header ~ .boxcar-wrapper > section:first-child,
.inner-header + .boxcar-wrapper section:first-of-type,
body.inner-header section:first-of-type {
  padding-top: 100px;
}

/* ── Card Component ──────────────────────────────────────── */
.box-car.car-block-three {
  padding: 0;
  width: 100%;
  max-width: 100%;
  flex: none;
}
.box-car .inner-box {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(0,0,0,0.03);
  position: relative;
}
.box-car .inner-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  box-shadow: 0 16px 40px -10px rgba(64,95,242,0.15);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.box-car .inner-box:hover {
  transform: translateY(-6px);
}
.box-car .inner-box:hover::after {
  opacity: 1;
}
.box-car .image-box a {
  display: block;
  height: 200px;
  overflow: hidden;
}
.box-car .image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.box-car .inner-box:hover .image-box img {
  transform: scale(1.05);
}
.box-car .content-box {
  padding: 14px 16px 12px;
}
.box-car .content-box .title {
  margin-bottom: 6px;
}
.box-car .content-box .title a {
  font-size: 14px;
  font-weight: 600;
  color: #050b20;
  line-height: 1.3;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Image heights per screen ────────────────────────────── */
@media (min-width: 1400px) {
  .box-car .image-box a {
    height: 220px;
  }
}
@media (max-width: 992px) {
  .box-car .image-box a {
    height: 200px;
  }
}
@media (max-width: 576px) {
  .box-car .image-box a {
    height: 180px;
  }
}

/* ── Featured / Related Grid (CSS Grid) ──────────────────── */
.featured-grid,
.related-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1200px) {
  .featured-grid,
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}
@media (max-width: 992px) {
  .featured-grid,
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}
@media (max-width: 576px) {
  .featured-grid,
  .related-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ── Inventory Grid (CSS Grid) ───────────────────────────── */
.vehicle-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1200px) {
  .vehicle-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}
@media (max-width: 768px) {
  .vehicle-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
.vehicle-grid .box-car {
  width: 100%;
  max-width: 100%;
  flex: none;
  padding: 0;
}

/* ── List Mode ───────────────────────────────────────────── */
.vehicle-grid.list-mode {
  grid-template-columns: 1fr;
}
.vehicle-grid.list-mode .inner-box {
  display: flex;
}
.vehicle-grid.list-mode .image-box {
  width: 280px;
  min-width: 280px;
  flex-shrink: 0;
}
.vehicle-grid.list-mode .image-box a {
  height: 100% !important;
  min-height: 180px;
}
.vehicle-grid.list-mode .content-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 768px) {
  .vehicle-grid.list-mode .inner-box {
    flex-direction: column;
  }
  .vehicle-grid.list-mode .image-box {
    width: 100%;
    min-width: 100%;
  }
  .vehicle-grid.list-mode .image-box a {
    height: 200px !important;
  }
}

/* ── Filter Sidebar ──────────────────────────────────────── */
.filter-sidebar {
  position: sticky;
  top: 90px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.03);
}
@media (max-width: 992px) {
  .filter-sidebar {
    position: static;
    margin-bottom: 24px;
    padding: 20px;
  }
}

/* ── Section Spacing ─────────────────────────────────────── */
.wiz-section {
  padding: 60px 0;
}
@media (max-width: 992px) {
  .wiz-section {
    padding: 40px 0;
  }
}
@media (max-width: 576px) {
  .wiz-section {
    padding: 32px 0;
  }
}

/* ── Hero Banner ─────────────────────────────────────────── */
.boxcar-banner-section-v1 .banner-content h2 {
  font-size: clamp(28px, 5vw, 48px);
}

/* ── Detail Page Gallery ─────────────────────────────────── */
.detail-gallery .main-img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  border-radius: 14px;
}
@media (max-width: 1200px) {
  .detail-gallery .main-img {
    height: 400px;
  }
}
@media (max-width: 992px) {
  .detail-gallery .main-img {
    height: 320px;
  }
}
@media (max-width: 576px) {
  .detail-gallery .main-img {
    height: 220px;
  }
}

/* ── Detail Sidebar ──────────────────────────────────────── */
.detail-sidebar {
  position: sticky;
  top: 90px;
}
@media (max-width: 992px) {
  .detail-sidebar {
    position: static;
    margin-top: 24px;
  }
}

/* ── Price Tag ───────────────────────────────────────────── */
.price-tag {
  font-size: clamp(24px, 4vw, 32px);
}

/* ── Spec Rows ───────────────────────────────────────────── */
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
  gap: 16px;
}
.spec-row:last-child {
  border-bottom: none;
}
@media (max-width: 576px) {
  .spec-row {
    font-size: 13px;
  }
}

/* ── Equipment Grid ──────────────────────────────────────── */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
@media (max-width: 576px) {
  .equip-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}
@media (max-width: 576px) {
  .pagination-bar {
    gap: 8px;
  }
}
.pagination-bar .page-num {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
}

/* ── Listing Toolbar ─────────────────────────────────────── */
.listing-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 576px) {
  .listing-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── Search Form on Hero ─────────────────────────────────── */
.hero-search-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-search-form .form-group {
  flex: 1;
  min-width: 140px;
}
@media (max-width: 768px) {
  .hero-search-form .form-group {
    min-width: calc(50% - 8px);
    flex: none;
    width: calc(50% - 8px);
  }
}
@media (max-width: 480px) {
  .hero-search-form .form-group {
    min-width: 100%;
    width: 100%;
  }
}

/* ── CTA Cards ───────────────────────────────────────────── */
.cta-card {
  border-radius: 16px;
  padding: 40px 32px;
  min-height: 200px;
}
@media (max-width: 576px) {
  .cta-card {
    padding: 28px 20px;
    min-height: 160px;
  }
}

/* ── Why Choose Cards ────────────────────────────────────── */
.why-card {
  padding: 32px 20px;
  border-radius: 16px;
  text-align: center;
}
@media (max-width: 576px) {
  .why-card {
    padding: 24px 16px;
  }
}

/* ── Footer ──────────────────────────────────────────────── */
.boxcar-footer .widgets-section {
  padding: 48px 0 32px;
}
@media (max-width: 768px) {
  .boxcar-footer .widgets-section {
    padding: 32px 0 20px;
  }
}

/* ── Typography Clamp ────────────────────────────────────── */
.section-heading h2, h2.title {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #050b20;
}

/* ── Modern UI / Glassmorphism ───────────────────────────── */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  border-radius: 20px;
}
.wiz-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Vehicle Card Interactions ────────────────────────────── */
.wishlist-card-btn.active svg {
  fill: #ff4757;
  stroke: #ff4757;
}
.wishlist-card-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 1) !important;
}

/* ── Select Inputs — Consistent Shape ────────────────────── */
select,
select.filter-input,
.hero-search-form .form-group select,
.sort-select {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 10px !important;
  padding: 10px 32px 10px 14px !important;
  font-size: 14px;
  line-height: 1.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
select:focus,
select.filter-input:focus,
.hero-search-form .form-group select:focus,
.sort-select:focus {
  border-color: #405FF2 !important;
  box-shadow: 0 0 0 3px rgba(64,95,242,0.1);
  outline: none;
}

/* ── Product Card — Image Bottom Radius Fix ──────────────── */
.box-car .image-box {
  border-radius: 12px 12px 0 0 !important;
  overflow: hidden;
  display: block !important;
  width: 100% !important;
}
.box-car .image-box a {
  border-radius: 0 !important;
}

/* ── Product Card — UI Polish ────────────────────────────── */
.box-car .inner-box {
  border-radius: 16px;
  overflow: hidden;
}
.box-car .inner-box::after {
  border-radius: 16px;
}
.box-car .content-box {
  padding: 16px 16px 12px !important;
}
.box-car .content-box .title a {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.box-car .content-box .text {
  margin-bottom: 10px;
}
.box-car .content-box ul {
  margin-bottom: 12px !important;
}
.box-car .content-box .btn-box {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 12px;
  margin-top: 4px;
}

/* ── Override style.css .car-block-three conflicts ───────── */
.vehicle-grid .car-block-three,
.featured-grid .car-block-three,
.related-grid .car-block-three {
  margin: 0 !important;
}
.featured-carousel .car-block-three {
  margin: 0 10px !important;
}
.car-block-three .inner-box .content-box {
  border: none !important;
  border-radius: 0 !important;
  margin-top: 0 !important;
  padding: 16px 16px 12px !important;
}
.car-block-three .inner-box .content-box .text {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 10px !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}
.car-block-three .inner-box .content-box ul:not(.vehicle-card-specs) {
  justify-content: flex-start !important;
  border-bottom: none !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
  padding: 0 !important;
}
.car-block-three .inner-box .content-box ul:not(.vehicle-card-specs) li {
  flex-direction: row !important;
  align-items: center !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  gap: 4px !important;
  font-size: 13px !important;
  color: #666 !important;
}
.car-block-three .inner-box .content-box ul:not(.vehicle-card-specs) li i {
  font-size: 14px !important;
  color: #405FF2 !important;
  margin-bottom: 0 !important;
}

/* Keep vehicle card specs in a single compact row on desktop. */
.car-block-three .inner-box .content-box ul.vehicle-card-specs {
  flex-wrap: nowrap !important;
  gap: 8px 6px !important;
  overflow: hidden !important;
  justify-content: flex-start !important;
  direction: ltr !important;
}

.car-block-three .inner-box .content-box ul.vehicle-card-specs li {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  white-space: nowrap !important;
  font-size: 11px !important;
  gap: 4px !important;
  padding: 5px 10px !important;
  border: 1px solid #dde6ff !important;
  border-radius: 999px !important;
  background: #f4f7ff !important;
  width: max-content !important;
}

.car-block-three .inner-box .content-box ul.vehicle-card-specs li i,
.car-block-three .inner-box .content-box ul.vehicle-card-specs li img {
  margin-bottom: 0 !important;
}
.car-block-three .inner-box .content-box .btn-box {
  padding: 12px 0 0 !important;
  position: relative !important;
  border-top: 1px solid rgba(0,0,0,0.06) !important;
}
.car-block-three .inner-box .content-box .btn-box .details {
  position: static !important;
}

/* ── Product Card — Inherit Parent Animation ─────────────── */
.featured-carousel .box-car,
.vehicle-grid .box-car,
.featured-grid .box-car,
.related-grid .box-car {
  opacity: 1;
  animation: none !important;
  -webkit-animation: none !important;
}
.wow .box-car,
[class*="wow"] .box-car {
  visibility: inherit !important;
  animation-name: inherit !important;
}

/* ── Browse Page — Toolbar Button Spacing ────────────────── */
.listing-toolbar .tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.listing-toolbar .sort-select {
  min-width: 160px;
  height: 42px;
  margin-right: 4px;
}
.listing-toolbar .view-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  gap: 0;
  padding: 0;
}
@media (max-width: 576px) {
  .listing-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .listing-toolbar .tools {
    justify-content: space-between;
  }
  .listing-toolbar .sort-select {
    flex: 1;
    min-width: 0;
  }
}

/* ── Browse Page — Filter Button Spacing ─────────────────── */
.filter-sidebar .filter-section {
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  padding-bottom: 16px;
}
.filter-sidebar .filter-section:last-child {
  border-bottom: none;
}

.filter-sidebar .filter-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 4px 0;
}
.filter-sidebar .filter-section-header h6 {
  font-size: 13px;
  font-weight: 700;
  color: #050b20;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.filter-sidebar .filter-section-header .toggle-icon {
  font-size: 10px;
  color: #999;
  transition: transform 0.3s ease;
}
.filter-sidebar .filter-section.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.filter-sidebar .filter-section-body {
  padding-top: 12px;
  transition: all 0.3s ease;
}
.filter-sidebar .filter-section.collapsed .filter-section-body {
  display: none;
}

.filter-sidebar .filter-input {
  width: 100%;
  border-radius: 12px !important;
  border: 1px solid #eee !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  transition: all 0.2s ease;
  background: #fcfcfc;
}
.filter-sidebar .filter-input:focus {
  border-color: #405FF2 !important;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(64, 95, 242, 0.05) !important;
}

.filter-sidebar .filter-btn {
  width: 100%;
  background: #405FF2;
  color: #fff;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  font-size: 14px;
  margin-top: 20px;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(64, 95, 242, 0.2);
}
.filter-sidebar .filter-btn:hover {
  background: #334ecf;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(64, 95, 242, 0.3);
}

.filter-sidebar .clear-btn {
  width: 100%;
  background: transparent;
  color: #666;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
  margin-top: 8px;
  border: 1px solid #eee;
  transition: all 0.2s ease;
}
.filter-sidebar .clear-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.filter-sidebar .more-filters-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #405FF2;
  cursor: pointer;
  margin: 16px 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(64, 95, 242, 0.05);
  transition: all 0.2s ease;
}
.filter-sidebar .more-filters-toggle:hover {
  background: rgba(64, 95, 242, 0.1);
}

/* ── Active Filters Bar — Spacing ────────────────────────── */
.active-filters-bar {
  gap: 6px;
  margin-bottom: 14px;
}

/* ── Utility ─────────────────────────────────────────────── */
.text-truncate-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 
   FIX: Mobile Sidebar Logo 
   Specifically target the logo in `#nav-mobile` to ensure it's constrained 
   even if JavaScript (mmenu) fails to initialize.
   Added object-fit and max-width for better iOS Safari consistency.
*/
#nav-mobile .sidebar-brand .sidebar-logo {
    max-height: 28px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
    filter: brightness(0) invert(1) !important;
    display: block !important;
}
