/* Quill indent support for lists: visually indent nested list items */
.article-detail .article-content li.ql-indent-1 {
  margin-left: 1.25rem;
}

.article-detail .article-content li.ql-indent-2 {
  margin-left: 2.5rem;
}

.article-detail .article-content li.ql-indent-3 {
  margin-left: 3.75rem;
}

.article-detail .article-content li.ql-indent-4 {
  margin-left: 5rem;
}

.article-detail .article-content li.ql-indent-5 {
  margin-left: 6.25rem;
}

/* Force scrollbar to always show for consistent viewport width across browsers */
html {
  overflow-y: scroll;
}

/* Categories (Home Cards) Section */
.categories-section {
  padding: 3rem 1rem 8rem 1rem;
  /* ������� ������ ������ */
  background: linear-gradient(180deg, var(--background) 60%, var(--muted) 100%);
  /* Make the categories section capable of filling the viewport (minus header) on larger screens */
  /* By default it behaves normally on small screens */
}

.categories-title {
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  color: var(--foreground);
  margin-bottom: 2.5rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch;
  /* г��� ������ ��� ��� ������ */
}

@media (min-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    /* г��� ������ ����� */
  }
}

@media (min-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    /* г��� ������ ����� */
  }
}

.category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: 0 4px 24px 0 rgba(20, 184, 166, 0.08);
  padding: 2rem 1.5rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* keep content stacked from the top so headings/descriptions align */
  min-height: 300px;
  /* ̳�������� ������ ��� ��� ������ */
  width: 100%;
  aspect-ratio: 1;
  /* ��������� ������ - ������������ */
}

.category-tile {
  cursor: pointer;
}

.category-tile:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.18);
  outline-offset: 4px;
}

.category-card:hover {
  box-shadow: 0 8px 32px 0 rgba(20, 184, 166, 0.18);
  transform: scale(1.04);
  border-color: var(--primary);
}

/* Disabled / Coming soon state */
/* Keep hover effects visible but make disabled cards non-interactive via JS.
   Using pointer-events:none prevents :hover styles from firing, so we avoid it here. */
.category-card[aria-disabled="true"] {
  opacity: 0.92;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.category-card[aria-disabled="true"] .category-name {
  color: var(--muted-foreground);
}

.category-card .category-meta.coming-soon {
  pointer-events: none;
  /* keep the coming-soon label non-interactive */
}

.category-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
  /* �� ���������� ������ ���������� */
}

.engines-bg {
  background: linear-gradient(135deg, #3a506b 60%, #14b8a6 100%);
}

.cars-bg {
  background: linear-gradient(135deg, #22c55e 60%, #16a34a 100%);
}

.articles-bg {
  background: linear-gradient(135deg, #a21caf 60%, #7c3aed 100%);
}

.category-svg {
  width: 2.25rem;
  height: 2.25rem;
  color: #fff;
}

.category-name {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
  margin-top: 0.25rem;
  color: var(--foreground);
  transition: color 0.2s;
  flex-shrink: 0;
  /* �� ���������� ��������� ���������� */
}

.category-card:hover .category-name {
  color: var(--primary);
}

.category-desc {
  color: var(--muted-foreground);
  font-size: 1rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  /* Reserve consistent vertical space so descriptions align across cards */
  min-height: 3.6rem;
  /* ~2 lines at 1rem font-size */
  /* clamp to two lines to avoid variable heights caused by translations */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.25rem;
}

@media (min-width: 1024px) {
  .category-desc {
    min-height: 4.2rem;
    /* more room for translations on wide screens */
  }
}

.category-meta {
  font-size: 0.95rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
  /* �� ���������� ����-���������� ���������� */
  margin-top: auto;
  /* anchor meta to bottom while keeping title/desc at consistent top positions */
}

.coming-soon {
  color: var(--accent);
  font-weight: 500;
}

/* Language dropdown active item */
.dropdown-menu .dropdown-item.active {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS Variables for Themes */
:root {
  /* Light theme as default - neutral blues with minimal teal */
  --background: #ffffff;
  --foreground: #0b132b;
  --card: #ffffff;
  --card-foreground: #1c2541;
  --popover: #ffffff;
  --popover-foreground: #0b132b;
  --primary: #3a506b;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #1c2541;
  --muted: #e2e8f0;
  --muted-foreground: #64748b;
  --accent: #5bc0be;
  --accent-foreground: #ffffff;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --border: #e2e8f0;
  --input: #ffffff;
  --ring: #3a506b;
  --radius: 0.5rem;
  /* Height reserved for sticky bottom ad; keep footer/content visible above it */
  --sticky-ad-height: 64px;
}

.light {
  /* Light theme with neutral blues and minimal green tint */
  --background: #ffffff;
  --foreground: #0b132b;
  --card: #ffffff;
  --card-foreground: #1c2541;
  --popover: #ffffff;
  --popover-foreground: #0b132b;
  --primary: #3a506b;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #1c2541;
  --muted: #e2e8f0;
  --muted-foreground: #64748b;
  --accent: #5bc0be;
  --accent-foreground: #ffffff;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --border: #e2e8f0;
  --input: #ffffff;
  --ring: #3a506b;
}

.dark {
  /* Dark theme variables */
  --background: #0f1115;
  --foreground: #f1f5f9;
  --card: #1a1f26;
  --card-foreground: #e2e8f0;
  --popover: #1a1f26;
  --popover-foreground: #f1f5f9;
  --primary: #14b8a6;
  --primary-foreground: #ffffff;
  --secondary: #0891b2;
  --secondary-foreground: #ffffff;
  --muted: #2d3748;
  --muted-foreground: #a0aec0;
  --accent: #14b8a6;
  --accent-foreground: #ffffff;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --border: #2d3748;
  --input: #1a1f26;
  --ring: #14b8a6;
}

/* Base Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: var(--sticky-ad-height);
  /* Reserve space equal to sticky ad height */
}

/* Fullscreen-ish hero behavior: keep footer off-screen on larger devices until user scrolls.
   We use a CSS variable --header-height (set by JS) so available space is accurate even when header
   height changes. On tablet/desktop we force the categories-section to occupy the remaining
   viewport height so footer isn't visible without scrolling. */
@media (min-width: 768px) {
  :root {
    --header-height: 64px;
    /* fallback, overridden by JS */
  }

  /* Ensure main content takes at least full viewport minus header */
  main.main-content {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
  }

  /* Simple centered layout: container inside section gets flexbox centering */
  .categories-section {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: calc(100vh - var(--header-height));
  }

  .categories-section .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    /* space between title and grid */
    margin-top: -160px;
    /* Move entire content up even more */
  }

  .categories-title {
    position: static;
    margin: 0;
    text-align: center;
    margin-top: -30px;
    /* Move title up independently from grid */
  }

  .categories-grid {
    align-items: center;
    justify-items: center;
    width: 100%;
    max-width: 1200px;
    box-sizing: border-box;
  }

  /* Make footer visually hidden until user scrolls: position static but pushed out of viewport
     because main content is full height. To ensure accessibility, we avoid using display:none. */
  /* footer remains after main; no extra CSS required here */
}

@media (min-width: 1024px) {

  /* On wide screens, increase header fallback and ensure categories remain centered */
  :root {
    --header-height: 64px;
  }

  .categories-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

.container {
  /* Match header base width so page body edges align with header */
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

/* Header Styles */
.header {
  border-bottom: 1px solid var(--border);
  background-color: var(--background);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 4rem;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  gap: 1.5rem;
}

/* Manufacturers Page Styles */
.hero-section {
  /* even tighter hero spacing (half of previous) */
  padding: 0.625rem 0;
  /* lift the hero up by 10px relative to manufacturers block */
  margin-top: -35px;
  /* moved up 10px more */
  text-align: center;
}

.hero-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}

.manufacturer-description {
  max-width: 900px;
  color: var(--muted-foreground, #9aa4b2);
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

.hero-with-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-direction: row;
  flex-wrap: nowrap;
}

.hero-content .hero-subtitle {
  margin-top: 0.25rem;
}

.manufacturer-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 10px;
  background-color: transparent;
  padding: 8px;
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.6);
}

@media (max-width: 600px) {
  .hero-with-logo {
    flex-direction: column;
  }

  .manufacturer-logo {
    width: 64px;
    height: 64px;
  }

  .hero-title {
    font-size: 1.35rem;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .manufacturer-logo {
    width: 72px;
    height: 72px;
  }

  .hero-title {
    font-size: 1.9rem;
  }
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--foreground);
}

/* Articles: tags and filter styling */
.articles-tags-filter {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 1.25rem 0 1.75rem 0;
  flex-wrap: wrap;
}

/* Dropdown styles for compact tag filter */
.tags-filter-form {
  width: 100%;
}

.tags-dropdown {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.5rem;
}

.tags-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  padding: 0;
  font-weight: 600;
}

.tags-dropdown-toggle .selected-count {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--muted-foreground);
}

.tags-dropdown-menu {
  position: static;
  background: transparent;
  border: none;
  padding: 0;
  min-width: auto;
  max-width: 100%;
  box-shadow: none;
  border-radius: 0;
  display: block;
}

.tags-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tags-actions button {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

.tags-actions .tags-apply {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.35rem 0.6rem;
}

.tags-list {
  max-height: none;
  overflow: visible;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.tags-list-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  color: var(--foreground);
  border: 1px solid rgba(255, 255, 255, 0.02);
}

/* Layout similar to engines filter: label left, chips right */
.tags-dropdown {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.tags-actions {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  font-weight: 600;
  color: var(--muted-foreground);
}

.tags-list {
  flex: 1 1 auto;
}

@media (max-width: 640px) {
  .tags-dropdown {
    flex-direction: column;
    align-items: flex-start;
  }

  .tags-actions {
    flex-direction: row;
    gap: 0.5rem;
  }
}

.tags-list-item input {
  transform: translateY(1px);
}

/* Make the tag label text look like a pill and show active state when the checkbox is checked */
.tags-list-item span {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.tags-list-item input {
  margin: 0 0.35rem 0 0;
}

.tags-list-item input:checked+span {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(18, 94, 90, 0.12);
  font-weight: 700;
}

.tags-list-item input:focus+span {
  outline: 3px solid rgba(20, 184, 166, 0.12);
  outline-offset: 3px;
}

/* For small selected-tag visual (if needed) */
.tag-filter {
  padding: 0.32rem 0.68rem;
  font-size: 0.92rem;
  margin-right: 0.45rem;
}

.articles-tags-filter .filter-label {
  color: var(--muted-foreground);
  font-weight: 600;
  margin-right: 0.5rem;
}

.tag-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0.32rem 0.68rem;
  /* slightly smaller pills */
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.92rem;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.04);
  margin-right: 0.4rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

/* Reset native button appearance when .tag-filter is used on <button>
   We explicitly remove default appearance but keep padding/border so they look like pills.
*/
.articles-tags-filter .tag-filter[type="button"],
.articles-tags-filter .tag-filter[role="button"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  color: var(--muted-foreground);
  cursor: pointer;
}

/* Stronger fallback for stubborn browser styles: force pill background and reset text-decoration */
.articles-tags-filter .tag-filter[type="button"] {
  background: var(--card) !important;
  border: 1px solid rgba(255, 255, 255, 0.03) !important;
  color: var(--muted-foreground) !important;
  text-decoration: none !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: 999px !important;
}

/* Ensure anchors don't fall back to browser defaults (underline/blue). Explicit link/visited rules help specificity. */
.articles-tags-filter .tag-filter:link,
.articles-tags-filter .tag-filter:visited,
.articles-tags-filter .tag-filter {
  /* Strongly override browser default link styles so these render as pills/buttons */
  text-decoration: none !important;
  color: var(--muted-foreground) !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.articles-tags-filter .tag-filter:hover,
.articles-tags-filter .tag-filter:focus,
.articles-tags-filter .tag-filter:active {
  text-decoration: none !important;
  outline: none !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08) !important;
}

.articles-tags-filter .tag-filter:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.15);
  outline-offset: 3px;
}

.tag-filter.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(18, 94, 90, 0.14);
  transform: translateY(-3px);
}

.article-tags {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.article-tag {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
}

/* back-button spacing variant for article detail */
.article-detail .back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  text-decoration: none;
  color: var(--muted-foreground);
  position: relative;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  margin: 0;
}

.manufacturers-section {
  /* halved spacing: very tight */
  padding: 0.375rem 0 0.625rem;
}

.manufacturers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .manufacturers-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 800px) {
  .manufacturers-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }
}

.manufacturer-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.005));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.5rem 1rem;
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 220px;
  width: 100%;
  backdrop-filter: blur(10px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.manufacturer-card:hover {
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.15);
}

.manufacturer-logo {
  width: 80px;
  height: 60px;
  /* use the same gradient as hover so the logo container looks identical */
  background-color: transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

.manufacturer-logo img {
  /* Prefer natural image dimensions but constrain to the box. This avoids
    upscaling small images beyond their native resolution and removes filters
    that can cause browser rasterization and blur. */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  position: static;
  transform: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

.manufacturer-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2rem;
  font-weight: bold;
  color: var(--foreground);
}

.manufacturer-name {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.manufacturer-count {
  font-size: 1rem;
  color: var(--muted-foreground);
  margin: 0;
  opacity: 0.8;
}

/* Logo (�����������) */
.logo-link {
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  justify-self: start;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s ease;
}

.logo-link:hover .logo {
  opacity: 0.8;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  background-color: var(--primary);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon span {
  color: var(--primary-foreground);
  font-weight: bold;
  font-size: 1.125rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--foreground);
}

/* Search Container (����������) */
.search-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 450px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  width: 1rem;
  height: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  background-color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 0.875rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
}

[data-theme="dark"] .search-results {
  background: var(--background-secondary-dark);
  border-color: var(--border-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-results-content {
  padding: 0.5rem 0;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-light);
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.2s ease;
  cursor: pointer;
}

[data-theme="dark"] .search-result-item {
  color: var(--text-dark);
  border-bottom-color: var(--border-dark);
}

.search-result-item:hover {
  background: var(--surface-light);
}

[data-theme="dark"] .search-result-item:hover {
  background: var(--surface-dark);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary);
  color: white;
  font-weight: bold;
  font-size: 0.875rem;
  overflow: hidden;
}

.search-result-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--foreground);
}

.search-result-subtitle {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.search-result-type {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background: var(--muted);
  color: var(--muted-foreground);
  text-transform: uppercase;
  font-weight: 500;
}

.search-no-results {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
}

.search-loading {
  padding: 1rem;
  text-align: center;
  color: var(--muted-foreground);
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
}

.control-btn {
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.2s;
}

.control-btn:hover {
  background-color: var(--muted);
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  min-width: 8rem;
  z-index: 50;
  display: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  text-align: left;
  color: var(--popover-foreground);
  cursor: pointer;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.sun-icon,
.moon-icon {
  width: 1rem;
  height: 1rem;
}

.dark .sun-icon {
  display: none;
}

.light .moon-icon,
body:not(.dark) .moon-icon {
  display: none;
}

.dark .moon-icon {
  display: block;
}

.light .sun-icon,
body:not(.dark) .sun-icon {
  display: block;
}

/* Main Content */
.main-content {
  flex: 1;
}

.hero-section {
  /* Reduced vertical space to tighten layout above the articles list */
  padding: 1.4rem 1rem;
}

.hero-text {
  text-align: center;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: bold;
  color: var(--foreground);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  max-width: 32rem;
  margin: 0 auto;
}

/* Manufacturer Grid */
.manufacturer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .manufacturer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .manufacturer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .manufacturer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.manufacturer-card {
  background: linear-gradient(135deg, var(--card) 0%, var(--card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  transition: all 0.2s ease;
  cursor: pointer;
}

.manufacturer-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
  /* muted hover color (dull teal) */
  background: linear-gradient(135deg, #2f6d6a 0%, #24383d 100%);
  border-color: rgba(47, 109, 106, 0.6);
}

.manufacturer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.manufacturer-logo {
  width: 6rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.manufacturer-card:hover .manufacturer-logo {
  /* use a desaturated/dull tone on logo hover */
  background: linear-gradient(135deg, #324a49 0%, #24383d 100%);
}

.manufacturer-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* On manufacturers listing page: remove background from logos so only the image shows */
.manufacturers-section .manufacturer-logo {
  background: transparent;
  box-shadow: none;
  border: none;
  border-radius: 0;
  padding: 0;
}

.manufacturers-section .manufacturer-card:hover .manufacturer-logo {
  background: transparent;
  box-shadow: none;
  border: none;
}

.manufacturer-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
  transition: color 0.2s;
}

.manufacturer-card:hover .manufacturer-info h3 {
  color: #b8d3d0;
  /* muted heading color on hover */
}

.manufacturer-info p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.engine-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* When using the engine list grid, style its child cards consistently here */
.engine-list-grid .engine-card {
  background: linear-gradient(135deg, var(--card) 0%, var(--card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  /* internal padding moved to .card-body */
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  transition: all 0.2s ease;
  cursor: pointer;
}

.engine-list-grid .engine-card .card-body {
  background: linear-gradient(135deg, var(--card) 0%, color-mix(in srgb, var(--card) 10%, transparent) 100%);
  color: var(--card-foreground, inherit);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
  width: 100%;
  box-sizing: border-box;
  min-height: 320px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.engine-list-grid .engine-card:hover,
.engine-list-grid .engine-card .card-body:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 25px -3px rgba(105, 12, 255, 0.1);
  border-color: var(--primary);
}

/* Engine Grid */
.engine-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .engine-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .engine-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .engine-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.engine-card {
  background: linear-gradient(135deg, var(--card) 0%, var(--card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
  transition: all 0.2s ease;
  cursor: pointer;
}

.engine-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.engine-image {
  width: 100%;
  height: 8rem;
  background-color: var(--muted);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.engine-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.engine-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.engine-card:hover .engine-info h3 {
  color: var(--primary);
}

.engine-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.engine-spec {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background-color: var(--muted);
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo-icon {
  width: 1.5rem;
  height: 1.5rem;
  background-color: var(--primary);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo-icon span {
  color: var(--primary-foreground);
  font-weight: bold;
  font-size: 0.875rem;
}

.footer-logo-text {
  font-weight: 600;
  color: var(--foreground);
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.footer-heading {
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--foreground);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.5rem 0;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Sticky Bottom Ad */
.sticky-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(71, 85, 105, 0.5);
  /* ensure the sticky ad occupies the reserved space */
  min-height: var(--sticky-ad-height);
  padding: 0.25rem 0;
  /* reduced vertical padding */
  z-index: 50;
}

.sticky-ad-content {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  /* center the ad box horizontally */
  height: 100%;
  box-sizing: border-box;
  position: relative;
}

.sticky-ad-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-ad-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-style: dashed;
  border-radius: 0.5rem;
  padding: 0.5rem 5rem;
  /* slimmer internal padding for compact banner */
  text-align: center;
}

.sticky-ad-header {
  margin-bottom: 0.15rem;
}

.ad-label {
  color: #94a3b8;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.sticky-ad-text {
  color: #e2e8f0;
  font-size: 0.825rem;
  font-weight: 500;
  margin: 0;
}

.sticky-ad-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  margin-left: 1rem;
  transition: color 0.2s;
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

.sticky-ad-close:hover {
  color: #e2e8f0;
}

/* Site Promo (duplicate of sticky-ad styles but with different class names to avoid adblock rules) */

/* close button removed � styles intentionally left out */

.site-promo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-promo-box {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(100, 116, 139, 0.12);
  border-radius: 0.5rem;
  padding: 0.5rem 1.25rem;
  /* slimmer horizontal padding for thin strip */
  text-align: center;
  display: inline-block;
}

/* Make the site promo a thin fixed strip at the bottom */
.site-promo {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--sticky-ad-height);
  padding: 0.25rem 0;
  background: rgba(15, 23, 42, 0.92);
  /* dark semi-opaque bar across full width */
  border-top: 1px solid rgba(71, 85, 105, 0.45);
}

.site-promo-content {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  box-sizing: border-box;
  position: relative;
}

.site-promo-header {
  margin-bottom: 0.15rem;
}

.promo-label {
  color: #94a3b8;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.site-promo-text {
  color: #e2e8f0;
  font-size: 0.825rem;
  font-weight: 500;
  margin: 0;
}

/* close button removed � no styles needed */

/* Cookie Consent */
.cookie-consent {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

/* Articles list styles */
.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Center the coming soon content when grid has this class */
.articles-grid.coming-soon-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 25vh;
  padding: 2rem 0;
  margin-top: -2rem;
}

/* Reduce top spacing inside articles section to tighten hero -> filter -> cards spacing */
.articles-section .container {
  padding-top: 0.5rem;
  /* reduce any default section padding */
  margin-top: 0;
}

.article-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.22s ease;
  display: block;
  cursor: pointer;
  will-change: transform, box-shadow;
}

.article-card .card-body {
  padding: 1rem 1.25rem;
}

.article-title {
  font-size: 1.125rem;
  margin: 0 0 0.5rem 0;
}

.article-title a {
  color: #a0aec0;
  text-decoration: none;
}

.article-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.article-excerpt {
  margin: 0;
  color: var(--muted-foreground);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-card:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 30px -6px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.article-tags {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.article-tag {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

/* nicer filter container (compact grouped layout) */
.nice-filter {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 1100px;
  margin: 0 auto;
}

.nice-filter .filter-left {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 0 0 160px;
  min-width: 120px;
}

.nice-filter .filter-scroll {
  display: flex;
  gap: 0.45rem;
  flex: 1 1 auto;
  flex-wrap: wrap;
  overflow: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  align-items: center;
}

.nice-filter .filter-scroll::-webkit-scrollbar {
  height: 8px;
}

.nice-filter .filter-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
}

@media (max-width: 640px) {
  .nice-filter {
    flex-direction: column;
    align-items: flex-start;
  }

  .nice-filter .filter-scroll {
    width: 100%;
  }
}

/* Article detail back button styling */

@media (min-width: 768px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Article detail styles */
.article-detail {
  width: 100%;
  max-width: 1260px;
  /* wider article column to match site container */
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Center only the article header elements: title, date/meta and tags.
   This keeps the article body/content layout unchanged. */
.article-detail h1 {
  text-align: center;
}

/* Make the meta (date + small meta items) stacked and centered for the article header */
.article-detail .article-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.article-detail .article-tags {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* push the article body a little lower so there's clear separation from header */
.article-detail .article-content {
  margin-top: 1.75rem;
}

/* Ensure article content is visible with proper spacing */
.article-detail .article-content,
.article-detail .article-content * {
  color: #a0aec0;
  visibility: visible !important;
  opacity: 1 !important;
}

.article-detail .article-content p,
.article-detail .article-content div {
  color: #a0aec0;
  margin: 1rem 0;
  line-height: 1.6;
}

.article-detail .article-content p:first-child {
  margin-top: 0;
}

.article-detail .article-content p:last-child {
  margin-bottom: 0;
}

/* Headings in article content */
.article-detail .article-content h1,
.article-detail .article-content h2,
.article-detail .article-content h3,
.article-detail .article-content h4,
.article-detail .article-content h5,
.article-detail .article-content h6 {
  color: #e2e8f0;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.article-detail .article-content h1 {
  font-size: 2rem;
}

.article-detail .article-content h2 {
  font-size: 1.75rem;
}

.article-detail .article-content h3 {
  font-size: 1.5rem;
}

.article-detail .article-content h4 {
  font-size: 1.25rem;
}

.article-detail .article-content h5 {
  font-size: 1.125rem;
}

.article-detail .article-content h6 {
  font-size: 1rem;
}

.article-detail .article-content h1:first-child,
.article-detail .article-content h2:first-child,
.article-detail .article-content h3:first-child,
.article-detail .article-content h4:first-child,
.article-detail .article-content h5:first-child,
.article-detail .article-content h6:first-child {
  margin-top: 0;
}

/* Quill indent support: map ql-indent-N to visible left margin in articles */
.article-detail .article-content p.ql-indent-1 {
  text-indent: 1.25rem;
  margin-left: 0;
}

.article-detail .article-content p.ql-indent-2 {
  text-indent: 2.5rem;
  margin-left: 0;
}

.article-detail .article-content p.ql-indent-3 {
  text-indent: 3.75rem;
  margin-left: 0;
}

.article-detail .article-content p.ql-indent-4 {
  text-indent: 5rem;
  margin-left: 0;
}

.article-detail .article-content p.ql-indent-5 {
  text-indent: 6.25rem;
  margin-left: 0;
}

/* TinyMCE alignment support */
.article-detail .article-content p[style*="text-align: left"],
.article-detail .article-content div[style*="text-align: left"] {
  text-align: left !important;
}

.article-detail .article-content p[style*="text-align: center"],
.article-detail .article-content div[style*="text-align: center"] {
  text-align: center !important;
}

.article-detail .article-content p[style*="text-align: right"],
.article-detail .article-content div[style*="text-align: right"] {
  text-align: right !important;
}

.article-detail .article-content p[style*="text-align: justify"],
.article-detail .article-content div[style*="text-align: justify"] {
  text-align: justify !important;
}

/* TinyMCE indent support */
.article-detail .article-content p[style*="padding-left"],
.article-detail .article-content div[style*="padding-left"] {
  padding-left: inherit !important;
}

/* Make sure lists and blockquotes in content look correct */
.article-detail .article-content ol,
.article-detail .article-content ul {
  margin: 1rem 0;
  padding-left: 2rem;
  line-height: 1.6;
  overflow: hidden;
  /* Create new block formatting context to respect float margins */
}

.article-detail .article-content li {
  margin: 0.5rem 0;
  color: #a0aec0;
}

.article-detail .article-content blockquote {
  border-left: 3px solid rgba(255, 255, 255, 0.06);
  padding-left: 1rem;
  color: var(--muted-foreground);
}

/* Images inside articles scale responsively */
.article-detail .article-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.75rem 0;
}

/* Image alignment with text wrapping */
.article-detail .article-content img[style*="float: left"],
.article-detail .article-content img[style*="float:left"] {
  float: left;
  margin: 0.5rem 1.5rem 0.5rem 0;
  display: inline;
}

.article-detail .article-content img[style*="float: right"],
.article-detail .article-content img[style*="float:right"] {
  float: right;
  margin: 0.5rem 0 0.5rem 1.5rem;
  display: inline;
}

.article-detail .article-content img[style*="display: block"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Tables inside articles (TinyMCE support) */
.article-detail .article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.article-detail .article-content table td,
.article-detail .article-content table th {
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a0aec0 !important;
}

.article-detail .article-content table th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

/* Article title in spec card */
.article-detail .article-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: #a0aec0;
  line-height: 1.2;
}

/* Related articles styling */
.related-articles-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.related-article-item {
  display: block;
  padding: 1rem;
  background: var(--muted);
  border-radius: 0.5rem;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.related-article-item:hover {
  background: var(--accent);
  border-color: var(--accent-foreground);
  transform: translateY(-2px);
}

.related-article-item h4 {
  margin: 0 0 0.5rem 0;
  color: var(--foreground);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.related-article-item time {
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

/* Browse articles content styling */
.browse-articles-content {
  text-align: center;
}

.browse-description {
  color: var(--muted-foreground);
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
  font-size: 0.9rem;
}

.browse-all-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: var(--primary-foreground);
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid var(--primary);
}

.browse-all-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.browse-all-button svg {
  transition: transform 0.2s ease;
}

.browse-all-button:hover svg {
  transform: translateX(2px);
}

/* Browse Articles List */
.browse-articles-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.browse-article-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #1a1f25;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: #a0aec0;
  transition: all 0.2s ease;
}

.browse-article-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

.browse-article-content {
  flex: 1;
  min-width: 0;
}

.browse-article-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: #a0aec0 !important;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* More specific selector for browse articles */
.sidebar-column .browse-articles-list .browse-article-item {
  color: #a0aec0 !important;
}

.sidebar-column .browse-articles-list .browse-article-item .browse-article-title {
  color: #a0aec0 !important;
}

.sidebar-column .browse-articles-list .browse-article-item h4 {
  color: #a0aec0 !important;
}

.browse-article-tag {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  opacity: 0.8;
}

.browse-article-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  flex-shrink: 0;
}

.browse-article-icon span {
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

.browse-all-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.browse-all-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.browse-all-link:hover {
  color: var(--accent-hover);
}

.browse-all-link svg {
  transition: transform 0.2s ease;
}

.browse-all-link:hover svg {
  transform: translateX(2px);
}

/* Sidebar Sponsored Content Block */
.sidebar-promo-content {
  padding: 0;
}

.sidebar-promo-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.sidebar-promo-link:hover {
  opacity: 0.9;
}

.sidebar-promo-wrapper {
  padding: 4px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.sidebar-promo-box {
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
  transition: all 0.2s ease;
}

.sidebar-promo-link:hover .sidebar-promo-wrapper {
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-promo-link:hover .sidebar-promo-box {
  background: var(--bg-hover);
}

.sidebar-promo-header {
  margin-bottom: 12px;
}

.promo-label {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-color);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-promo-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Code blocks formatting (Quill's code-block) */
.article-detail .article-content pre {
  background: rgba(0, 0, 0, 0.12);
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  color: var(--foreground);
}

/* Stronger override to ensure article column aligns with the intended narrow layout
   Use a specific selector and !important to prevent accidental overrides elsewhere. */
.container>.article-detail {
  max-width: 1260px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  box-sizing: border-box !important;
}

/* Ensure that when the article uses both .container and .article-detail classes
   we enforce the narrow column and add a temporary visual outline for verification. */
.container.article-detail {
  max-width: 1260px !important;
  box-sizing: border-box !important;
}

.article-detail .back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  text-decoration: none;
  color: var(--muted-foreground);
  position: relative;
}

.article-detail .breadcrumb {
  margin-bottom: 0.5rem;
}

.cookie-content {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 28rem;
  text-align: center;
}

.cookie-content p {
  color: var(--card-foreground);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.cookie-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.cookie-accept {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.cookie-accept:hover {
  opacity: 0.9;
}

.cookie-decline {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.cookie-decline:hover {
  background-color: var(--muted);
}

/* Admin Login Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: var(--background);
}

.login-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 24rem;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--foreground);
}

.login-header p {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--foreground);
  font-size: 0.875rem;
}

.form-group input {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--input);
  color: var(--foreground);
  font-size: 0.875rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

.login-btn {
  padding: 0.75rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.login-btn:hover {
  opacity: 0.9;
}

.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-loading {
  display: none;
}

.login-btn.loading .btn-text {
  display: none;
}

.login-btn.loading .btn-loading {
  display: inline;
}

.login-error {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-align: center;
}

.login-demo {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: var(--muted);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.login-demo p {
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.login-demo p:first-child {
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-container {
    padding: 0 0.5rem;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
  }

  .search-container {
    max-width: none;
  }

  .search-wrapper {
    max-width: none;
  }

  .hero-title {
    font-size: 1.875rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .container {
    padding: 0 0.5rem;
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

.show {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Manufacturers Page Styles */
.search-section {
  background: rgba(30, 41, 59, 0.5);
  padding: 2rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.search-filter-wrapper {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  z-index: 1;
}

.search-input-main {
  width: 100%;
  padding: 12px 12px 12px 44px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 16px;
  transition: all 0.3s ease;
}

.search-input-main:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input-main::placeholder {
  color: #64748b;
}

.manufacturers-section {
  /* halved spacing: very tight */
  padding: 0.375rem 0;
  /* lift the manufacturers grid up by ~50px to reduce vertical gap */
  margin-top: -15px;
  /* moved down by 10px from previous -25px */
}

.manufacturer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.manufacturer-logo {
  width: 120px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  /* remove extra padding so images can use full box resolution */
  padding: 0;
}

.manufacturer-logo img {
  /* Prefer natural image dimensions but constrain to the box. This
       avoids upscaling small images beyond their native resolution. */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.25s ease;
  /* Hint the browser for crisper scaling and use GPU compositing */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

.manufacturer-card:hover .manufacturer-logo img {
  /* soften hover scale to avoid noticeable blurring from larger upscales */
  transform: scale(1.02);
}

.manufacturer-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  font-size: 24px;
  font-weight: bold;
}

.manufacturer-info {
  flex: 1;
}

.manufacturer-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
}

.manufacturer-description {
  color: #94a3b8;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.manufacturer-engines {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
}

.engine-count {
  font-size: 1.25rem;
  font-weight: bold;
  color: #3b82f6;
}

.engine-label {
  color: #94a3b8;
  font-size: 0.9rem;
}

.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: #64748b;
}

.no-results-content {
  max-width: 400px;
  margin: 0 auto;
}

.no-results svg {
  opacity: 0.5;
  margin-bottom: 1rem;
}

.no-results h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #94a3b8;
}

.no-results p {
  color: #64748b;
}

/* Responsive Design for Manufacturers */
@media (max-width: 768px) {
  .manufacturers-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .manufacturer-card {
    padding: 1.5rem;
  }

  .manufacturer-content {
    gap: 1rem;
  }

  .search-filter-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  .search-box {
    max-width: none;
  }
}

/* Engines Page Styles */
.manufacturer-header {
  background: rgba(30, 41, 59, 0.5);
  padding: 2rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: #3b82f6;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: #64748b;
}

.manufacturer-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 0.5rem;
}

.manufacturer-subtitle {
  font-size: 1.2rem;
  color: #94a3b8;
}

/* Engines Grid - Redesigned for exactly 4 cards per row */
.engines-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0.5rem !important;
  margin-top: 1rem !important;
}

@media (min-width: 640px) {
  .engines-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }
}

@media (min-width: 1024px) {
  .engines-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.5rem !important;
    max-width: 100% !important;
  }
}

/* Force override any conflicting rules */
.engines-section .engines-grid {
  grid-template-columns: 1fr !important;
}

@media (min-width: 640px) {
  .engines-section .engines-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 1024px) {
  .engines-section .engines-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Engine Card - Ultra-compact for 4 per row */
.engines-section .engine-card,
.engine-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(51, 65, 85, 0.6) 100%);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.engine-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15), 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Desktop layout - horizontal ultra-compact */
@media (min-width: 1024px) {

  .engines-section .engine-card,
  .engine-card {
    flex-direction: row !important;
    align-items: stretch !important;
    height: 90px !important;
    min-height: 90px !important;
    padding: 0 !important;
    max-width: none !important;
  }
}

/* Engine Image */
.engine-image {
  width: 100%;
  height: 100px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.engine-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.engine-card:hover .engine-image img {
  transform: scale(1.05);
}

@media (min-width: 1024px) {

  .engines-section .engine-image,
  .engine-image {
    width: 30% !important;
    height: 100% !important;
  }
}

/* Engine Info */
.engine-info {
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 1024px) {

  .engines-section .engine-info,
  .engine-info {
    width: 70% !important;
    padding: 0.4rem !important;
  }
}

/* Engine Title */
.engine-info h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.2rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engine-type {
  color: #cbd5e1;
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

/* Engine Specs - Chips */
.engine-specs {
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.engine-chip {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(99, 102, 241, 0.15) 100%);
  color: #e2e8f0;
  padding: 3px 6px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Engine type badge - smaller and refined */
.engine-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 5px;
  border-radius: 8px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.engine-badge.badge-petrol {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.engine-badge.badge-diesel {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.engine-badge.badge-electric {
  background: linear-gradient(135deg, #10b981, #059669);
}

.engine-badge.badge-hybrid {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.engine-badge.badge-gas {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.engine-badge.badge-unknown {
  background: rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}

.no-engines,
.coming-soon {
  text-align: center;
  padding: 4rem 2rem;
}

.no-engines-content,
.coming-soon {
  max-width: 600px;
  margin: 0 auto;
}

.no-engines h1,
.coming-soon h2 {
  font-size: 2rem;
  color: #e2e8f0;
  margin-bottom: 1rem;
}

.no-engines p,
.coming-soon p {
  color: #94a3b8;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #3b82f6;
  color: white;
  border: 1px solid #3b82f6;
}

.btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  transform: translateY(-1px);
}

/* Responsive Design for Engines */
@media (max-width: 768px) {
  .category-card {
    aspect-ratio: unset;
    /* ³�������� ��������� ������ �� �������� */
    min-height: 250px;
    /* ����� ������ ��� �������� */
    padding: 1.5rem;
  }

  .category-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1rem;
  }

  .category-svg {
    width: 1.75rem;
    height: 1.75rem;
  }

  .category-name {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  .category-desc {
    font-size: 0.9rem;
    line-height: 1.4;
  }


  .manufacturer-title {
    font-size: 2rem;
  }

  .manufacturer-subtitle {
    font-size: 1rem;
  }

  .breadcrumb {
    flex-wrap: wrap;
  }

  .nav-left {
    gap: 0.75rem;
  }

  .nav-left .nav-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
  }

  .header-container {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 1rem;
  }

  .search-container {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin: 0;
  }

  .search-wrapper {
    max-width: 100%;
  }

  .search-results {
    max-height: 300px;

  }

  .search-result-item {
    padding: 0.5rem 0.75rem;
    gap: 0.75rem;
  }

  .search-result-icon {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
  }

  .search-result-title {
    font-size: 0.9rem;
  }

  .search-result-subtitle {
    font-size: 0.8rem;
  }
}

/* Engine Detail Page Styles */

.engine-header {
  padding: 1.25rem 0;
  /* tighter vertical spacing */
  background: transparent;
  /* keep page bg, card appears inside */
}

/* Make the container inside engine-header stretch so the visual card can span wide */
.engine-header .container {
  /* let the header container match the global .container width */
  max-width: 1260px;
  /* match global container */
  margin: 0 auto;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.engine-header-content {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
  /* make the visual card fill the header container */
  width: 100%;
  max-width: none;
  margin: 0;
  /* adjust header card height */
  min-height: 190px;
  align-items: center;
  /* center vertically */
}

.engine-title-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
}

.manufacturer-logo-small {
  width: 112px;
  /* increased size */
  height: auto;
  object-fit: contain;
  background: transparent;
  /* allow transparent PNG/SVG to show */
  border-radius: 0;
  /* remove boxed background */
  padding: 0;
  /* remove extra padding */
  margin-left: 0.75rem;
  /* small offset from left edge */
  display: block;
}

.engine-title-info {
  flex: 1;
  min-width: 0;
  /* Allow flex item to shrink */
  max-width: 68.75%;
  /* Match the left column width: 2.2fr / (2.2fr + 1fr) = 2.2/3.2 = 68.75% */
}

.engine-title-info h1.engine-title {
  font-size: 1.75rem;
  /* slightly larger to balance bigger logo and taller card */
  font-weight: 600;
  color: var(--card-foreground);
  margin: 0;
}

.engine-manufacturer {
  color: var(--muted-foreground);
  font-size: 0.95rem;
  margin: 0;
}

.engine-search-summary-card {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  max-width: 64ch;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.engine-search-summary-label {
  display: inline-block;
  margin-bottom: 0.3rem;
  color: #7dd3fc;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.9;
}

.engine-search-summary {
  margin: 0;
  color: #bcc9d8;
  font-size: 0.93rem;
  line-height: 1.7;
  max-width: 64ch;
  text-wrap: pretty;
}

.key-stats {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 480px;
}

.stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  text-align: center;
  min-width: 84px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 6px 18px rgba(2, 6, 23, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  /* subtle colored accent stripe */
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 60%;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  opacity: 0.95;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--card-foreground);
  margin-bottom: 0.15rem;
  padding-left: 0.6rem;
  /* space for accent */
}

.stat-label {
  font-size: 0.65rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding-left: 0.6rem;
  /* align with value */
}

.stat-card:hover {
  /* neutralize hover: keep the same appearance as the base .stat-card */
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 6px 18px rgba(2, 6, 23, 0.35);
}

.engine-content {
  padding: 1.5rem 0;
}

.content-grid {
  display: grid;
  /* slightly increase left column so right sidebar is a bit narrower */
  grid-template-columns: 2.2fr 1fr;
  gap: 1.5rem;
}

.specifications-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.spec-card {
  background: #1a1f26;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  overflow: hidden;
  /* make content left-aligned and stretch full width */
  display: block;
  text-align: left;
  width: 100%;
  max-width: none;
  margin: 0;
}

/* Header inside each spec card: left-aligned with a bottom divider */
.spec-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: transparent;
}

.spec-card-header h3 {
  margin: 0;
  text-align: left;
  font-size: 1.05rem;
}

.spec-card-content {
  font-size: 0.95rem;
  font-weight: 350;
  padding: 0.75rem 1rem;
  color: #a0aec0;
  text-align: left;
}

.spec-card-header svg {
  color: #3b82f6;
  flex-shrink: 0;
}

.spec-card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0;
}

.spec-card-content {
  font-size: 0.95rem;
  font-weight: 350;
  padding: 0.75rem;
  color: #a0aec0;
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.specs-column {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  color: #94a3b8;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.spec-value {
  color: #e2e8f0;
  font-weight: 500;
  text-align: right;
  margin-left: 1rem;
}

.engine-image-section {
  padding: 0;
}

.engine-detail-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

/* Gallery Styles */
.car-gallery {
  width: 100%;
  position: relative;
}

.gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #1e293b;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Smooth image scaling to reduce pixelation */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: smooth;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0) scale(1.0, 1.0);
  transform: translateZ(0);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
}

.gallery-nav:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
  left: 10px;
}

.gallery-next {
  right: 10px;
}

.gallery-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 0;
}

.gallery-thumb {
  width: 70px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  flex-shrink: 0;
  /* Smooth image scaling to reduce pixelation */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: smooth;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.gallery-thumb:hover {
  opacity: 0.8;
}

.gallery-thumb.active {
  opacity: 1;
  border-color: #ef4444;
}

.gallery-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.1);
  border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.5);
  border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
  background: rgba(239, 68, 68, 0.7);
}

.pros-cons-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pros-section,
.cons-section {
  padding: 1rem;
  border-radius: 8px;
}

.pros-section {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.cons-section {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.pros-title {
  color: #22c55e;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.cons-title {
  color: #ef4444;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.pros-text,
.cons-text {
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

/* Responsive Design for Engine Detail */
@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .engine-title-info {
    max-width: 100%;
    /* Full width when content becomes single column */
  }

  .specs-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .engine-title-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .engine-title-info h1.engine-title {
    font-size: 1.5rem;
  }

  .engine-search-summary-card {
    width: 100%;
    max-width: none;
    padding-top: 0.6rem;
  }

  .engine-search-summary {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .key-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .spec-card-content {
    padding: 1rem;
  }

  .spec-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .spec-value {
    text-align: left;
    margin-left: 0;
  }
}

/* Breadcrumb Section and Back Button */
.breadcrumb-section {
  padding: 1rem 0;
  position: relative;
  z-index: 10;
  background: var(--surface-light);
}

[data-theme="dark"] .breadcrumb-section {
  background: var(--surface-dark);
}

.breadcrumb-section .container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.breadcrumb-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--muted-foreground);
}

/* Back Button Universal Styles */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: transparent;
  color: var(--secondary-foreground);
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  position: relative;
  z-index: 20;
  pointer-events: auto;
}

.back-button:hover {
  background: var(--accent);
  color: var(--accent-foreground);
  transform: translateX(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Place breadcrumb back-button similar to articles.php: slightly higher and left */
.breadcrumb-section .back-button {
  margin-top: -0.35rem;
  margin-left: 0;
  transform: translateY(-2px);
  align-self: flex-start;
  width: auto;
}

/* Static content pages: FAQ, Privacy, Terms layout and cards */
.content-section {
  padding: 2.5rem 0 3.5rem 0;
}

.content-section .container {
  max-width: 980px;
  margin: 0 auto;
}

.support-page-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 900px) {
  .support-page-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

.support-info-card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  padding: 1.25rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.06);
}

.support-info-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.support-info-card p,
.support-info-card ul {
  color: var(--muted-foreground);
  line-height: 1.65;
}

.support-info-card ul {
  margin-left: 1.1rem;
}

.support-info-card a {
  color: var(--primary);
  text-decoration: underline;
}





.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary-light);
}

[data-theme="dark"] .breadcrumb {
  color: var(--text-secondary-dark);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.breadcrumb a:hover {
  opacity: 0.7;
}

.breadcrumb span {
  color: var(--text-secondary-light);
}

[data-theme="dark"] .breadcrumb span {
  color: var(--text-secondary-dark);
}

/* Advantages and Issues Lists */
.advantages-list,
.issues-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.advantage-item,
.issue-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.advantage-item {
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.1);
}

[data-theme="dark"] .advantage-item {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.2);
}

.issue-item {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.1);
}

[data-theme="dark"] .issue-item {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.advantage-icon,
.issue-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.advantage-icon {
  background: #22c55e;
  color: white;
}

.issue-icon {
  background: #f59e0b;
  color: white;
}

.advantage-text,
.issue-text {
  flex: 1;
  line-height: 1.5;
  color: var(--text-light);
}

[data-theme="dark"] .advantage-text,
[data-theme="dark"] .issue-text {
  color: var(--text-dark);
}

/* Vehicles List */
.vehicles-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* slightly tighter vertical spacing */
}

.vehicle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  /* reduced space between dot and name */
  padding: 6px 10px;
  /* smaller vertical padding for denser list */
  border-radius: 6px;
  background: var(--surface-light);
  border: 1px solid var(--border-light);
  transition: all 0.18s ease;
}

[data-theme="dark"] .vehicle-item {
  background: var(--background-secondary-dark);
  border-color: var(--border-dark);
}

.vehicle-item:hover {
  transform: translateX(4px);
  border-color: var(--primary);
}

.vehicle-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.vehicle-name {
  color: var(--text-light);
  font-weight: 500;
}

[data-theme="dark"] .vehicle-name {
  color: var(--text-dark);
}

/* Spec Card Improvements */
.advantages-card .spec-card-header svg {
  color: #22c55e;
}

.issues-card .spec-card-header svg {
  color: #f59e0b;
}

.vehicles-card .spec-card-header svg {
  color: var(--primary);
}

/* Coming Soon Section */
.coming-soon-section {
  padding: 4rem 1rem;
  background: var(--surface-light);
}

[data-theme="dark"] .coming-soon-section {
  background: var(--surface-dark);
}

.coming-soon-content {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  padding: 2rem;
}

.coming-soon-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.coming-soon-icon svg {
  color: var(--primary);
  opacity: 0.8;
}

.coming-soon-title {
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-light);
  margin-bottom: 1rem;
}

[data-theme="dark"] .coming-soon-title {
  color: var(--text-dark);
}

.coming-soon-desc {
  font-size: 1.1rem;
  color: var(--text-secondary-light);
  line-height: 1.6;
}

[data-theme="dark"] .coming-soon-desc {
  color: var(--text-secondary-dark);
}

/* ========================================= */
/* ����� ����: 4-��������� Ѳ��� �����Ͳ�    */
/* ========================================= */

/* ������� ���� */

.four-column-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .four-column-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .four-column-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .four-column-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ����� ������: ������ ������� */
.compact-engine-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.9) 0%, rgba(15, 23, 30, 0.85) 100%);
  border: 1px solid rgba(71, 85, 105, 0.12);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  min-height: 320px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
}

.compact-engine-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
  /* muted hover color (dull teal) - match manufacturer cards */
  background: linear-gradient(135deg, #2f6d6a 0%, #24383d 100%);
  border-color: rgba(47, 109, 106, 0.6);
}

/* keyboard focus mirrors hover for accessibility */
.compact-engine-card:focus-visible {
  outline: none;
  transform: scale(1.05);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #2f6d6a 0%, #24383d 100%);
  border-color: rgba(47, 109, 106, 0.6);
}

/* Image top layout */
.compact-engine-image {
  width: 100%;
  height: 140px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.compact-engine-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.compact-engine-card:hover .compact-engine-image img {
  transform: scale(1.06);
}

/* Info area */
.compact-engine-info {
  padding: 1rem 1rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compact-engine-info h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  line-height: 1.15;
  white-space: normal;
  word-break: break-word;
}

.compact-engine-meta {
  color: #cbd5e1;
  font-size: 0.9rem;
}

.compact-engine-type {
  opacity: 0.95;
}

/* Specs (chips) row */
.compact-engine-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
  margin-top: 4px;
}

.compact-spec-chip {
  background: rgba(59, 130, 246, 0.12);
  color: #e6eef8;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(59, 130, 246, 0.18);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.compact-spec-chip:hover {
  /* preserve base appearance on hover (no visual change) */
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.18);
}

/* ����� ���� ������ */
.compact-fuel-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.compact-fuel-badge.badge-petrol {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.compact-fuel-badge.badge-diesel {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.compact-fuel-badge.badge-electric {
  background: linear-gradient(135deg, #10b981, #059669);
}

.compact-fuel-badge.badge-hybrid {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.compact-fuel-badge.badge-gas {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.compact-fuel-badge.badge-unknown {
  background: rgba(148, 163, 184, 0.5);
  color: #cbd5e1;
}

/* ���������� ��� ������ */
.compact-engine-info {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

@media (min-width: 1024px) {
  .compact-engine-info {
    width: 65%;
    padding: 0.6rem;
  }
}

.compact-engine-info h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 0.25rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-engine-type {
  color: #cbd5e1;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  opacity: 0.9;
}

/* ׳�� ������������� */
.compact-engine-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  align-items: center;
}

/* Filter pill chips (reference style) */
.filter-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-chip:hover {
  background: transparent;
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

/* Tailwind-like utilities for reference implementation */
.block {
  display: block;
  text-decoration: none;
  color: inherit;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-1 {
  flex: 1 1 0%;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.space-y-6>*+* {
  margin-top: 1.5rem;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.h-10 {
  height: 2.5rem;
}

.rounded-md {
  border-radius: 0.375rem;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.rounded-full {
  border-radius: 9999px;
}

.rounded-t-lg {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.border {
  border-width: 1px;
}

.border-border {
  border-color: var(--border);
}

.border-input {
  border-color: var(--input);
}

.bg-card {
  background-color: var(--card);
}

.bg-background {
  background-color: var(--background);
}

.bg-primary {
  background-color: var(--primary);
}

.bg-muted {
  background-color: var(--muted);
}

.text-card-foreground {
  color: var(--card-foreground);
}

.text-foreground {
  color: var(--foreground);
}

.text-primary-foreground {
  color: var(--primary-foreground);
}

.text-muted-foreground {
  color: var(--muted-foreground);
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.shadow-sm {
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.shadow-xl {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.duration-200 {
  transition-duration: 200ms;
}

.duration-300 {
  transition-duration: 300ms;
}

.cursor-pointer {
  cursor: pointer;
}

.overflow-hidden {
  overflow: hidden;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.shrink-0 {
  flex-shrink: 0;
}

.object-cover {
  object-fit: cover;
}

.p-0 {
  padding: 0px;
}

.p-6 {
  padding: 1.5rem;
}

.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.py-1\.5 {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.py-0\.5 {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-6 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.ring-offset-background {
  --tw-ring-offset-color: var(--background);
}

.ring-ring {
  --tw-ring-color: var(--ring);
}

.ring-offset-2 {
  --tw-ring-offset-width: 2px;
}

.focus\:ring-2:focus {
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
}

.focus\:outline-none:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.focus-visible\:outline-none:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.focus-visible\:ring-2:focus-visible {
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000);
}

.hover\:bg-muted:hover {
  background-color: var(--muted);
}

.hover\:shadow-xl:hover {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.hover\:scale-\[1\.02\]:hover {
  transform: scale(1.02);
}

.group:hover .group-hover\:scale-105 {
  transform: scale(1.05);
}

.group:hover .group-hover\:text-primary {
  color: var(--primary);
}

.w-fit {
  width: fit-content;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 2;
}

.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-card {
  --tw-gradient-from: var(--card) var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(255, 255, 255 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.to-card\/80 {
  --tw-gradient-to: var(--card) var(--tw-gradient-to-position);
}

.from-muted {
  --tw-gradient-from: var(--muted) var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(255, 255, 255 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.to-muted\/60 {
  --tw-gradient-to: var(--muted) var(--tw-gradient-to-position);
}

.hover\:from-primary\/10:hover {
  --tw-gradient-from: var(--primary) var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(255, 255, 255, 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.hover\:to-primary\/5:hover {
  --tw-gradient-to: var(--primary) var(--tw-gradient-to-position);
}

.hover\:border-primary\/20:hover {
  border-color: var(--primary);
}

/* Grid utilities */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* Responsive grid */
@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sm\:flex-row {
    flex-direction: row;
  }

  .sm\:items-center {
    align-items: center;
  }

  .sm\:w-auto {
    width: auto;
  }

  .sm\:w-64 {
    width: 16rem;
  }

  .sm\:w-40 {
    width: 10rem;
  }

  .sm\:flex-initial {
    flex: 0 1 auto;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Aspect ratio utilities */
.aspect-\[4\/3\] {
  aspect-ratio: 4 / 3;
}

/* Badge colors */
.bg-green-100 {
  background-color: rgb(220 252 231);
}

.text-green-800 {
  color: rgb(22 101 52);
}

.border-green-300 {
  border-color: rgb(134 239 172);
}

.bg-red-100 {
  background-color: rgb(254 226 226);
}

.text-red-800 {
  color: rgb(153 27 27);
}

.border-red-300 {
  border-color: rgb(252 165 165);
}

.bg-emerald-100 {
  background-color: rgb(209 250 229);
}

.text-emerald-800 {
  color: rgb(6 95 70);
}

.border-emerald-300 {
  border-color: rgb(110 231 183);
}

.bg-violet-100 {
  background-color: rgb(237 233 254);
}

.text-violet-800 {
  color: rgb(91 33 182);
}

.border-violet-300 {
  border-color: rgb(196 181 253);
}

.bg-cyan-100 {
  background-color: rgb(207 250 254);
}

.text-cyan-800 {
  color: rgb(21 94 117);
}

.border-cyan-300 {
  border-color: rgb(103 232 249);
}

.bg-slate-100 {
  background-color: rgb(241 245 249);
}

.text-slate-800 {
  color: rgb(30 41 59);
}

.border-slate-300 {
  border-color: rgb(203 213 225);
}

/* Reference-style engine card (block) */
.block {
  text-decoration: none;
  color: inherit;
}

.block [data-slot="card"] {
  background: linear-gradient(180deg, var(--card) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.block [data-slot="card"]:hover {
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.3), 0 0 0 1px rgba(20, 184, 166, 0.4);
  transform: translateY(-6px) scale(1.02);
  background: linear-gradient(135deg, rgba(47, 109, 106, 0.06) 0%, rgba(36, 56, 61, 0.03) 100%);
  border-color: rgba(20, 184, 166, 0.5);
}

.block .aspect-\[4\/3\] {
  /* escapes for bracket class */
  position: relative;
  width: 100%;
  padding-top: calc(3 / 4 * 100%);
  overflow: hidden;
}

.block .aspect-\[4\/3\] img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.block:hover .aspect-\[4\/3\] img {
  transform: scale(1.05);
}

.bg-card {
  background: var(--card);
}

.text-card-foreground {
  color: var(--card-foreground);
}

.border-border {
  border-color: var(--border);
}

.group-hover\:text-primary:hover {
  color: var(--primary);
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shadow-sm {
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
}

.hover\:shadow-xl:hover {
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.12);
}

.hover\:scale-\[1\.02\]:hover {
  transform: scale(1.02);
}

.transition-all {
  transition: all 0.2s ease;
}

.compact-spec-chip {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(99, 102, 241, 0.2) 100%);
  color: #e2e8f0;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.3);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  margin: 0;
}

.compact-spec-chip:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35) 0%, rgba(99, 102, 241, 0.3) 100%);
  border-color: rgba(59, 130, 246, 0.5);
}

/* Filter Panel Styles (Reference Implementation) */
#filtersToggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#filtersToggle:hover {
  background: var(--muted);
}

#filtersToggle svg {
  width: 1rem;
  height: 1rem;
}

#filtersPanel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#filtersPanel.hidden {
  display: none;
}

#filtersPanel.show {
  display: block;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-checkbox {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: var(--background);
  accent-color: var(--primary);
}

.filter-checkbox:checked {
  background: var(--primary);
  border-color: var(--primary);
}

/* View Toggle Buttons */
/* view-toggle removed in markup - no styles needed */


/* Sort Select Styling */
#sortBy {
  background: transparent;
  border: none;
  color: var(--foreground);
  font-size: 0.95rem;
  /* slightly larger to match reference */
  font-weight: 600;
  cursor: pointer;
  padding: 0 0.25rem;
  min-width: 11rem;
  /* more space so label fits */
  outline: none;
}

/* Sort block and direction toggle */
.sort-block {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sort-direction-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.sort-direction-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.sort-direction-btn[aria-pressed="true"] svg {
  transform: rotate(180deg);
}

/* Filters Toggle Button (for articles page) - match engines button */
#filtersToggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}

#filtersToggle:hover {
  background: var(--muted);
}

/* Custom select dropdown appearance (dark dropdown mimic) */
select#sortBy {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

select#sortBy::-ms-expand {
  display: none;
}

/* Dropdown options are browser-native; we add darker background on the select for better contrast */
select#sortBy {
  background-color: rgba(15, 17, 20, 0.6);
  color: var(--foreground);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* On focus show an outline */
select#sortBy:focus {
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
  outline: none;
}

#sortBy:focus {
  outline: none;
}

/* Results Count */
#resultsCount {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Filter checkbox labels */
.filter-checkbox+span {
  font-size: 0.875rem;
  color: var(--foreground);
  cursor: pointer;
}

/* Filter section headers */
#filtersPanel h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.75rem;
}

/* Responsive filter panel */
@media (max-width: 768px) {
  #filtersPanel {
    padding: 1rem;
  }

  #filtersPanel .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Precise layout for filter panel columns to match reference */
#filtersPanel {
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  /* slightly larger radius like reference */
  border: 1px solid rgba(255, 255, 255, 0.03);
}

#filtersPanel .grid {
  gap: 1.5rem;
}

#filtersPanel>.grid>div {
  min-width: 0;
  /* prevent overflow */
}

#filtersPanel h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 0.75rem 0;
}

/* Labels/rows inside each column */
#filtersPanel .space-y-2 {
  display: flex;
  flex-direction: column;
}

#filtersPanel label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
  cursor: pointer;
}

#filtersPanel .filter-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 4px;
  background: transparent;
  flex: 0 0 auto;
  margin: 0;
}

#filtersPanel .filter-checkbox:focus {
  outline: 2px solid rgba(20, 184, 166, 0.12);
  outline-offset: 2px;
}

#filtersPanel .text-sm {
  font-size: 0.95rem;
  color: var(--foreground);
}

/* Ensure 4 equal columns on large screens */
@media (min-width: 1024px) {
  #filtersPanel .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 640px) {
  .flex.flex-col.sm\\:flex-row {
    flex-direction: column;
    align-items: stretch;
  }

  .flex.items-center.gap-4:first-child {
    flex-wrap: wrap;
    justify-content: center;
  }

  #resultsCount {
    text-align: center;
  }
}

/* Top controls container tweaks: remove solid bg and tighten padding */
.engines-section .top-controls,
.engines-section .flex.flex-col.sm\:flex-row {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* Ensure Sort by label and select fit and don't wrap */
.engines-section .flex.items-center>.flex.items-center {
  min-width: 240px;
  white-space: nowrap;
}

.engines-section .flex.items-center>.flex.items-center span {
  white-space: nowrap;
}

/* ������������ ��� �������� */
@media (max-width: 640px) {
  .compact-engine-card {
    margin-bottom: 0.5rem;
  }

  .compact-engine-info {
    padding: 0.6rem;
  }

  .compact-engine-info h3 {
    font-size: 0.95rem;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }
}

/* ============================================
   CONTACT PAGE STYLING
   ============================================ */

/* Contact Form Container */
.contact-form-container {
  max-width: 600px;
  margin: 2rem auto;
  background: #1a1f26;
  padding: 2rem;
  border-radius: 0.5rem;
  border: 1px solid #2d3748;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.contact-form-container h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #f1f5f9;
  font-size: 1.5rem;
  text-align: center;
}

/* Form Styling */
.contact-form {
  width: 100%;
}

.form-field {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #f1f5f9;
  font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #2d3748;
  border-radius: 0.375rem;
  background: #0f1419;
  color: #f1f5f9;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  cursor: pointer;
}

/* CAPTCHA Placeholder */
.captcha-placeholder {
  padding: 2rem;
  border: 2px dashed #2d3748;
  border-radius: 0.375rem;
  background: #1a1f26;
  text-align: center;
  color: #94a3b8;
}

.captcha-placeholder p {
  margin: 0 0 0.5rem 0;
  font-weight: 500;
  color: #94a3b8;
}

.captcha-placeholder small {
  color: #64748b;
  opacity: 0.8;
}

/* Submit Button */
.form-submit-btn {
  width: 100%;
  background: #3b82f6;
  color: #ffffff;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.form-submit-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.form-submit-btn:active {
  transform: translateY(0);
}

/* Contact Info Card */
.contact-info-card {
  max-width: 400px;
  margin: 2rem auto 0;
  text-align: center;
  padding: 1.5rem;
  background: #1a1f26;
  border-radius: 0.5rem;
  border: 1px solid #2d3748;
}

.contact-info-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #f1f5f9;
  font-size: 1.2rem;
}

.contact-info-card p {
  margin-bottom: 0.5rem;
  color: #f1f5f9;
}

.contact-info-card p:last-child {
  margin-bottom: 0;
}

.contact-info-card a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-info-card a:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 640px) {

  .contact-form-container,
  .contact-info-card {
    margin-left: 1rem;
    margin-right: 1rem;
    padding: 1.5rem;
  }

  .contact-form-container h2 {
    font-size: 1.3rem;
  }

  .form-input,
  .form-select,
  .form-textarea,
  .form-submit-btn {

    font-size: 16px;
    /* Prevents zoom on iOS */
  }
}

/* Quill alignment support for public article content */
.ql-align-left {
  text-align: left;
}

.ql-align-center {
  text-align: center;
}

.ql-align-right {
  text-align: right;
}

.ql-align-justify {
  text-align: justify;
}

/* Detailed specifications styling */
.detailed-specs {
  line-height: 1.6;
  color: var(--card-foreground);
  font-size: 0.9rem;
}

.detailed-specs p {
  margin-bottom: 0.75rem;
}

.detailed-specs strong {
  color: var(--primary);
  font-weight: 600;
}

/* Enhanced spec cards for better readability */
.spec-card .detailed-specs {
  white-space: pre-line;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.spec-card .detailed-specs br {
  display: block;
  content: "";
  margin-top: 0.5rem;
}

/* Engine description styling */
.engine-description {
  font-family: inherit;
  line-height: 1.6;
  color: inherit;
  /* �������� ���� �� .spec-card-content */
}

.engine-description p {
  margin-bottom: 1rem;
  text-align: justify;
  text-indent: 2em;
  /* ³����� ������� ����� ������ */
  color: inherit;
  /* �������� ���� �� ������������ �������� */
}

.engine-description p:last-child {
  margin-bottom: 0;
}

/* Engine Variants Section */
.variants-description {
  margin-bottom: 1.5rem;
  color: #94a3b8;
  font-style: italic;
}

/* Parent Engine Section */
.parent-description {
  margin-bottom: 1.5rem;
  color: #94a3b8;
  font-style: italic;
}

.parent-engine-card {
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.parent-engine-card:hover {
  border-color: rgba(20, 184, 166, 0.4);
  background: rgba(20, 184, 166, 0.15);
}

.parent-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(20, 184, 166, 0.2);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.parent-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.3;
}

.parent-badge {
  background: rgba(20, 184, 166, 0.2);
  color: #5eead4;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.parent-specs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.parent-spec {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

.parent-actions {
  margin-top: auto;
}

.parent-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 6px;
  color: #5eead4;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
}

.parent-link:hover {
  background: rgba(20, 184, 166, 0.25);
  border-color: rgba(20, 184, 166, 0.5);
  color: #7dd3fc;
  text-decoration: none;
}

.parent-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.parent-link:hover svg {
  transform: translateX(2px);
}

/* Engine variant tags - compact tag-like display */
.engine-variants-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.engine-variant-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  color: #60a5fa;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.engine-variant-tag:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.tag-power {
  background: rgba(59, 130, 246, 0.2);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #93c5fd;
}

/* Responsive adjustments for variant tags */
@media (max-width: 768px) {
  .engine-variants-tags {
    gap: 0.375rem;
  }

  .engine-variant-tag {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
  }

  .tag-power {
    font-size: 0.7rem;
    padding: 0.125rem 0.25rem;
  }
}

/* Engine variants tags in header */
.engine-variants-tags-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.75rem;
  max-width: 100%;
  overflow: hidden;
}

.engine-variant-tag-header {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 4px;
  color: #60a5fa;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.engine-variant-tag-header:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.engine-parent-tag-header {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 4px;
  color: #5eead4;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.engine-parent-tag-header:hover {
  background: rgba(20, 184, 166, 0.2);
  border-color: rgba(20, 184, 166, 0.4);
  color: #7dd3fc;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.2);
}

/* Responsive adjustments for header variant tags */
@media (max-width: 768px) {
  .engine-title-info {
    max-width: 100%;
    /* Full width on mobile */
  }

  .engine-variants-tags-header {
    gap: 0.25rem;
    margin-top: 0.5rem;
  }

  .engine-variant-tag-header {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }

  .engine-parent-tag-header {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
}

/* New Related Engines Styles */
.related-engines-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.related-engine-item {
  display: block;
  padding: 0.5rem;
  background: transparent;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  border-left: 3px solid #06b6d4;
}

.related-engine-item:hover {
  background: rgba(91, 192, 190, 0.2);
  border-color: rgba(91, 192, 190, 0.4);
  border-left-color: #60a5fa;
  transform: translateX(4px);
}

.related-engine-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.related-engine-info {
  flex: 1;
  min-width: 0;
}

.related-engine-name {
  font-weight: 600;
  color: #94a3b8;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.related-engine-specs {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.related-fuel-badge {
  flex-shrink: 0;
}

.fuel-letter {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.related-engine-item:hover .related-engine-name {
  color: #e2e8f0;
}

.related-engine-item:hover .related-engine-specs {
  color: #cbd5e1;
}

.related-engine-item:hover .fuel-letter {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.related-engines-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.view-all-engines-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--secondary-foreground);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.view-all-engines-link:hover {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}

/* Vehicles List Scrollable */
.vehicles-scrollable {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 8px;
}

.vehicles-scrollable::-webkit-scrollbar {
  width: 6px;
}

.vehicles-scrollable::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.vehicles-scrollable::-webkit-scrollbar-thumb {
  background: rgba(91, 192, 190, 0.6);
  border-radius: 3px;
  transition: background 0.2s ease;
}

.vehicles-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(91, 192, 190, 0.8);
}

/* Firefox scrollbar */
.vehicles-scrollable {
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 192, 190, 0.6) rgba(255, 255, 255, 0.1);
}

/* Related Engines Sidebar Styles */
.related-engines-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.related-engine-item {
  display: block;
  padding: 0.5rem;
  background: transparent;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  border-left: 3px solid #06b6d4;
}

.related-engine-item:hover {
  background: var(--accent);
  border-color: var(--accent);
  border-left-color: #60a5fa;
  transform: translateX(4px);
}

.related-engine-specs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.125rem;
}

.related-spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
}

.related-spec-value {
  font-weight: 600;
  color: #94a3b8;
  font-size: 0.8rem;
}

.related-spec-label {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.related-engine-item:hover .related-spec-value {
  color: #ffffff;
}

.related-engine-item:hover .related-spec-label {
  color: #cbd5e1;
}

.related-engines-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.view-all-engines-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--secondary-foreground);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.view-all-engines-link:hover {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}

/* Related Engines Sidebar Styles */
.related-engines-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.related-engine-item {
  display: block;
  padding: 0.5rem;
  background: transparent;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  border-left: 3px solid #06b6d4;
}

.related-engine-item:hover {
  background: var(--accent);
  border-color: var(--accent);
  border-left-color: #60a5fa;
  transform: translateX(4px);
}

.related-engine-specs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.125rem;
}

.related-spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
}

.related-spec-value {
  font-weight: 600;
  color: #94a3b8;
  font-size: 0.8rem;
}

.related-spec-label {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.related-engine-item:hover .related-spec-value {
  color: #ffffff;
}

.related-engine-item:hover .related-spec-label {
  color: #cbd5e1;
}

.related-engines-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.view-all-engines-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--secondary-foreground);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 500;
}

/* Units conversion toggle */
#units-toggle-container {
  display: flex;
  align-items: center;
}

.units-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.units-label {
  display: none;
}

.units-switch {
  position: relative;
  display: inline-flex;
  background: #0a0e1a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.units-switch input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.units-option {
  position: relative;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 2;
  user-select: none;
}

.units-switch input[type="radio"]:checked+.units-option {
  color: #ffffff;
}

.units-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  border-radius: 6px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

.units-switch:hover .units-slider {
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .breadcrumb-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  #units-toggle-container {
    width: 100%;
  }
}

.unit-value {
  transition: color 0.2s ease;
}

/* Smooth image scaling for all car and manufacturer images */
img[src*="/images/cars/"],
img[src*="/images/manufacturers/"],
img[alt*="car"],
img[alt*="Car"],
.object-contain,
.object-cover {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: smooth;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.unit-value[title] {
  cursor: help;
  border-bottom: 1px dotted currentColor;
}

/* Alternative units display */
.unit-alt {
  color: #94a3b8;
  font-size: 0.9em;
  margin-left: 0.25rem;
  font-weight: 400;
}