/* ================================================
   Vehicle Info Plugin — Frontend CSS
   ================================================ */

:root {
  --vi-primary: #1a56db;
  --vi-primary-dark: #1340b0;
  --vi-accent: #f97316;
  --vi-text: #1e293b;
  --vi-text-light: #64748b;
  --vi-border: #e2e8f0;
  --vi-bg: #f8fafc;
  --vi-white: #ffffff;
  --vi-radius: 12px;
  --vi-radius-sm: 8px;
  --vi-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --vi-shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
  --vi-transition: all 0.25s ease;
}

/* ---- Container ---- */
.vi-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Breadcrumb ---- */
.vi-breadcrumb {
  background: var(--vi-bg);
  border-bottom: 1px solid var(--vi-border);
  padding: 12px 0;
  font-size: 13px;
  color: var(--vi-text-light);
}
.vi-breadcrumb a { color: var(--vi-primary); text-decoration: none; }
.vi-breadcrumb a:hover { text-decoration: underline; }
.vi-bc-sep { margin: 0 6px; }

/* ================================================
   BRAND GRID
   ================================================ */
.vi-brands-grid {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}
.vi-brands-grid.vi-cols-2 { grid-template-columns: repeat(2, 1fr); }
.vi-brands-grid.vi-cols-3 { grid-template-columns: repeat(3, 1fr); }
.vi-brands-grid.vi-cols-4 { grid-template-columns: repeat(4, 1fr); }
.vi-brands-grid.vi-cols-6 { grid-template-columns: repeat(6, 1fr); }

.vi-brand-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  background: var(--vi-white);
  border: 1px solid var(--vi-border);
  border-radius: var(--vi-radius);
  text-decoration: none;
  color: var(--vi-text);
  transition: var(--vi-transition);
  text-align: center;
}
.vi-brand-card:hover {
  border-color: var(--vi-primary);
  box-shadow: var(--vi-shadow-hover);
  transform: translateY(-3px);
  color: var(--vi-text);
}
.vi-brand-logo { width: 80px; height: 60px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.vi-brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.vi-brand-placeholder {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--vi-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.vi-brand-name { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.vi-brand-country { font-size: 12px; color: var(--vi-text-light); display: block; }
.vi-brand-count { font-size: 12px; color: var(--vi-primary); display: block; margin-top: 4px; }

/* ================================================
   VEHICLE GRID & CARDS
   ================================================ */
.vi-vehicle-grid {
  display: grid;
  gap: 20px;
  margin: 20px 0;
}
.vi-vehicle-grid.vi-cols-2 { grid-template-columns: repeat(2, 1fr); }
.vi-vehicle-grid.vi-cols-3 { grid-template-columns: repeat(3, 1fr); }
.vi-vehicle-grid.vi-cols-4 { grid-template-columns: repeat(4, 1fr); }

.vi-vehicle-card {
  background: var(--vi-white);
  border: 1px solid var(--vi-border);
  border-radius: var(--vi-radius);
  overflow: hidden;
  transition: var(--vi-transition);
  display: flex;
  flex-direction: column;
}
.vi-vehicle-card:hover {
  box-shadow: var(--vi-shadow-hover);
  transform: translateY(-4px);
  border-color: var(--vi-primary);
}
.vi-card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--vi-bg);
}
.vi-card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.vi-vehicle-card:hover .vi-card-image img { transform: scale(1.05); }
.vi-no-image {
  height: 100%; display: flex; align-items: center;
  justify-content: center; color: var(--vi-border);
}
.vi-card-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--vi-primary); color: white;
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px;
}
.vi-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.vi-card-brand { font-size: 12px; color: var(--vi-primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.vi-card-title {
  font-size: 16px; font-weight: 700; margin: 4px 0 10px; line-height: 1.4;
}
.vi-card-title a { color: var(--vi-text); text-decoration: none; }
.vi-card-title a:hover { color: var(--vi-primary); }
.vi-card-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.vi-meta-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--vi-text-light);
}
.vi-meta-item svg { flex-shrink: 0; }
.vi-card-price {
  font-size: 17px; font-weight: 700;
  color: var(--vi-accent); margin: 8px 0 12px;
}
.vi-card-btn {
  display: inline-block; margin-top: auto;
  background: var(--vi-primary); color: white;
  padding: 9px 18px; border-radius: var(--vi-radius-sm);
  text-decoration: none; font-size: 13px; font-weight: 600;
  text-align: center; transition: var(--vi-transition);
}
.vi-card-btn:hover { background: var(--vi-primary-dark); color: white; }

/* ================================================
   FILTER BAR
   ================================================ */
.vi-filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: center; padding: 16px;
  background: var(--vi-white); border: 1px solid var(--vi-border);
  border-radius: var(--vi-radius); margin-bottom: 24px;
}
.vi-filter-select {
  padding: 9px 14px; border: 1px solid var(--vi-border);
  border-radius: var(--vi-radius-sm); font-size: 14px;
  background: var(--vi-white); color: var(--vi-text);
  cursor: pointer; flex: 1; min-width: 140px;
}
.vi-filter-reset {
  padding: 9px 16px; border: 1px solid var(--vi-border);
  border-radius: var(--vi-radius-sm); background: var(--vi-bg);
  cursor: pointer; font-size: 13px; color: var(--vi-text-light);
}
.vi-filter-reset:hover { border-color: var(--vi-primary); color: var(--vi-primary); }

/* ================================================
   TYPES GRID
   ================================================ */
.vi-types-grid {
  display: grid; gap: 14px; margin: 20px 0;
}
.vi-types-grid.vi-cols-2 { grid-template-columns: repeat(2, 1fr); }
.vi-types-grid.vi-cols-4 { grid-template-columns: repeat(4, 1fr); }

.vi-type-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; background: var(--vi-white);
  border: 1px solid var(--vi-border); border-radius: var(--vi-radius);
  text-decoration: none; color: var(--vi-text);
  transition: var(--vi-transition);
}
.vi-type-card:hover { border-color: var(--vi-primary); box-shadow: var(--vi-shadow); color: var(--vi-text); }
.vi-type-icon { font-size: 32px; }
.vi-type-name { font-size: 15px; font-weight: 600; display: block; }
.vi-type-count { font-size: 12px; color: var(--vi-text-light); }

/* ================================================
   SEARCH
   ================================================ */
.vi-search-wrap { margin: 20px 0; }
.vi-search-form {}
.vi-search-inner {
  display: flex; border: 2px solid var(--vi-border);
  border-radius: 50px; overflow: hidden; background: var(--vi-white);
  transition: var(--vi-transition);
}
.vi-search-inner:focus-within { border-color: var(--vi-primary); }
.vi-search-input {
  flex: 1; padding: 14px 20px; border: none;
  font-size: 15px; outline: none; background: transparent;
}
.vi-search-btn {
  padding: 0 20px; background: var(--vi-primary); border: none;
  color: white; cursor: pointer; display: flex; align-items: center;
  transition: var(--vi-transition);
}
.vi-search-btn:hover { background: var(--vi-primary-dark); }

/* ================================================
   PAGINATION
   ================================================ */
.vi-pagination { margin: 30px 0; text-align: center; }
.vi-pagination .page-numbers {
  display: inline-block; padding: 8px 14px; margin: 0 3px;
  border: 1px solid var(--vi-border); border-radius: var(--vi-radius-sm);
  color: var(--vi-text); text-decoration: none; font-size: 14px;
}
.vi-pagination .page-numbers.current { background: var(--vi-primary); color: white; border-color: var(--vi-primary); }
.vi-pagination .page-numbers:hover:not(.current) { border-color: var(--vi-primary); color: var(--vi-primary); }

/* ================================================
   SECTION TITLE
   ================================================ */
.vi-section-title {
  font-size: 26px; font-weight: 700; color: var(--vi-text);
  margin: 36px 0 20px; padding-bottom: 12px;
  border-bottom: 3px solid var(--vi-primary);
  display: inline-block;
}

/* ================================================
   NO RESULTS
   ================================================ */
.vi-no-results { color: var(--vi-text-light); padding: 30px; text-align: center; }
.vi-no-results-large { text-align: center; padding: 60px 20px; }
.vi-no-results-icon { font-size: 64px; margin-bottom: 16px; }

/* ================================================
   SINGLE VEHICLE - HERO
   ================================================ */
.vi-single-vehicle { background: var(--vi-bg); min-height: 100vh; }
.vi-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  padding: 40px 0; align-items: start;
}
.vi-main-image {
  border-radius: var(--vi-radius); overflow: hidden;
  background: var(--vi-white); border: 1px solid var(--vi-border);
}
.vi-main-image img { width: 100%; height: 380px; object-fit: cover; display: block; }
.vi-no-image-large {
  height: 380px; display: flex; align-items: center;
  justify-content: center; color: var(--vi-border);
}
.vi-thumbnails {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.vi-thumb {
  width: 80px; height: 60px; border-radius: var(--vi-radius-sm);
  overflow: hidden; cursor: pointer; border: 2px solid var(--vi-border);
  transition: var(--vi-transition);
}
.vi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vi-thumb.active, .vi-thumb:hover { border-color: var(--vi-primary); }

/* Hero Info */
.vi-hero-info {}
.vi-status-badge {
  display: inline-block; padding: 4px 14px; border-radius: 20px;
  color: white; font-size: 12px; font-weight: 600; margin-bottom: 12px;
}
.vi-hero-brand { font-size: 13px; font-weight: 700; color: var(--vi-primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.vi-hero-brand a { color: inherit; text-decoration: none; }
.vi-hero-title { font-size: 30px; font-weight: 800; color: var(--vi-text); margin: 0 0 16px; line-height: 1.2; }
.vi-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.vi-tag {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: var(--vi-bg); border: 1px solid var(--vi-border); color: var(--vi-text-light);
}
.vi-tag-type { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.vi-tag-seg  { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.vi-tag-fuel { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.vi-tag-year { background: #faf5ff; border-color: #e9d5ff; color: #7c3aed; }

.vi-hero-price {
  background: linear-gradient(135deg, #fff7ed, #fffbeb);
  border: 1px solid #fed7aa; border-radius: var(--vi-radius);
  padding: 16px 20px; margin-bottom: 20px;
}
.vi-price-label { font-size: 12px; color: var(--vi-text-light); display: block; margin-bottom: 4px; }
.vi-price-value { font-size: 24px; font-weight: 800; color: var(--vi-accent); }

/* Quick specs */
.vi-quick-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.vi-quick-spec-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--vi-white);
  border: 1px solid var(--vi-border); border-radius: var(--vi-radius-sm);
}
.vi-qs-icon { font-size: 20px; }
.vi-qs-label { font-size: 11px; color: var(--vi-text-light); display: block; }
.vi-qs-value { font-size: 13px; font-weight: 600; color: var(--vi-text); }
.vi-color-options { font-size: 13px; color: var(--vi-text-light); margin-top: 12px; }

/* ================================================
   TABS
   ================================================ */
.vi-tabs-wrap { margin: 40px 0; }
.vi-tabs-nav {
  display: flex; gap: 4px; border-bottom: 2px solid var(--vi-border);
  margin-bottom: 0; flex-wrap: wrap;
}
.vi-tab-nav-btn {
  padding: 12px 20px; border: none; background: transparent;
  cursor: pointer; font-size: 14px; font-weight: 500; color: var(--vi-text-light);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: var(--vi-transition);
}
.vi-tab-nav-btn:hover { color: var(--vi-primary); }
.vi-tab-nav-btn.active { color: var(--vi-primary); border-bottom-color: var(--vi-primary); }

.vi-tab-panel {
  display: none; padding: 30px;
  background: var(--vi-white); border: 1px solid var(--vi-border);
  border-top: none; border-radius: 0 0 var(--vi-radius) var(--vi-radius);
}
.vi-tab-panel.active { display: block; }

/* Spec tables */
.vi-spec-heading { font-size: 18px; font-weight: 700; margin: 0 0 16px; color: var(--vi-text); }
.vi-spec-table { width: 100%; border-collapse: collapse; }
.vi-spec-table th, .vi-spec-table td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--vi-border);
  font-size: 14px;
}
.vi-spec-table th { color: var(--vi-text-light); width: 200px; font-weight: 500; background: var(--vi-bg); }
.vi-spec-table td { color: var(--vi-text); font-weight: 500; }
.vi-spec-table tr:last-child th, .vi-spec-table tr:last-child td { border-bottom: none; }
.vi-spec-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }

/* Features */
.vi-feature-section { margin-bottom: 28px; }
.vi-feature-heading { font-size: 17px; font-weight: 700; margin: 0 0 14px; color: var(--vi-text); }
.vi-feature-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.vi-feature-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.vi-check { color: #16a34a; font-weight: 700; }

/* Gallery */
.vi-gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.vi-gallery-item { position: relative; border-radius: var(--vi-radius-sm); overflow: hidden; aspect-ratio: 4/3; }
.vi-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.vi-gallery-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s;
}
.vi-gallery-item:hover img { transform: scale(1.08); }
.vi-gallery-item:hover .vi-gallery-overlay { opacity: 1; }

/* Video */
.vi-video-wrap { position: relative; padding-bottom: 56.25%; height: 0; }
.vi-video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: var(--vi-radius-sm); }

/* Description */
.vi-description { font-size: 15px; line-height: 1.8; color: var(--vi-text); }

/* ================================================
   RELATED
   ================================================ */
.vi-related-section { margin: 40px 0; }

/* ================================================
   LIGHTBOX
   ================================================ */
.vi-lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.9);
  z-index: 999999; display: flex; align-items: center; justify-content: center;
}
.vi-lb-content { max-width: 90vw; max-height: 90vh; }
.vi-lb-content img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: var(--vi-radius); }
.vi-lb-close, .vi-lb-prev, .vi-lb-next {
  position: absolute; background: rgba(255,255,255,0.1);
  border: none; color: white; font-size: 28px; cursor: pointer;
  width: 48px; height: 48px; display: flex; align-items: center;
  justify-content: center; border-radius: 50%;
  transition: background 0.2s;
}
.vi-lb-close:hover, .vi-lb-prev:hover, .vi-lb-next:hover { background: rgba(255,255,255,0.25); }
.vi-lb-close { top: 20px; right: 20px; }
.vi-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.vi-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ================================================
   BRAND PAGE
   ================================================ */
.vi-brand-hero {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white; padding: 50px 0;
}
.vi-brand-hero-inner { display: flex; gap: 30px; align-items: center; }
.vi-brand-hero-logo { background: white; padding: 20px; border-radius: var(--vi-radius); }
.vi-brand-hero-logo img { max-width: 120px; max-height: 100px; object-fit: contain; }
.vi-brand-placeholder-lg {
  width: 100px; height: 100px; background: var(--vi-primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700; color: white;
}
.vi-brand-hero-title { font-size: 36px; font-weight: 800; margin: 0 0 12px; }
.vi-brand-hero-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.vi-brand-hero-meta span { font-size: 14px; opacity: 0.85; }
.vi-brand-website-btn {
  display: inline-block; padding: 10px 20px; background: var(--vi-primary);
  color: white; text-decoration: none; border-radius: var(--vi-radius-sm);
  font-size: 14px; font-weight: 600; transition: var(--vi-transition);
}
.vi-brand-website-btn:hover { background: var(--vi-primary-dark); color: white; }

/* ================================================
   ARCHIVE
   ================================================ */
.vi-archive-header {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white; padding: 40px 0;
}
.vi-archive-tax-label {
  display: inline-block; background: rgba(255,255,255,0.15);
  padding: 4px 12px; border-radius: 20px; font-size: 12px;
  margin-bottom: 10px;
}
.vi-archive-title { font-size: 32px; font-weight: 800; margin: 0 0 10px; }
.vi-archive-count { font-size: 14px; opacity: 0.7; }
.vi-archive-filter { margin: 24px 0; }
.vi-filter-group, .vi-sort-group { display: flex; gap: 10px; flex: 1; }

/* ================================================
   FEATURED SECTION
   ================================================ */
.vi-featured-section { margin: 30px 0; }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
  .vi-hero { grid-template-columns: 1fr; }
  .vi-brands-grid.vi-cols-4 { grid-template-columns: repeat(3, 1fr); }
  .vi-vehicle-grid.vi-cols-4 { grid-template-columns: repeat(3, 1fr); }
  .vi-spec-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .vi-brands-grid.vi-cols-3,
  .vi-brands-grid.vi-cols-4,
  .vi-brands-grid.vi-cols-6 { grid-template-columns: repeat(2, 1fr); }
  .vi-vehicle-grid.vi-cols-3,
  .vi-vehicle-grid.vi-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .vi-types-grid.vi-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .vi-quick-specs { grid-template-columns: 1fr; }
  .vi-feature-list { grid-template-columns: 1fr; }
  .vi-gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .vi-hero-title { font-size: 24px; }
  .vi-brand-hero-inner { flex-direction: column; text-align: center; }
  .vi-filter-bar { flex-direction: column; }
  .vi-tabs-nav { overflow-x: auto; }
}

@media (max-width: 480px) {
  .vi-vehicle-grid.vi-cols-2,
  .vi-vehicle-grid.vi-cols-3,
  .vi-vehicle-grid.vi-cols-4 { grid-template-columns: 1fr; }
  .vi-brands-grid { grid-template-columns: repeat(2, 1fr); }
}
