:root {
  --bg-main: #0b0f17;
  --bg-card: #131b2a;
  --bg-card-hover: #1c273c;
  --bg-glass: rgba(19, 27, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(239, 68, 68, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  --accent-gold: #f59e0b;
  --accent-cyan: #06b6d4;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(239, 68, 68, 0.25);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Atmosphere */
.bg-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background: 
    radial-gradient(circle at 15% 15%, rgba(239, 68, 68, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 70%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.04) 0%, transparent 60%);
}

/* Containers */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0;
  transition: var(--transition);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-gold));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.brand-title span {
  color: var(--accent-red);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Language Selector */
.lang-selector-wrap {
  position: relative;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-red);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #131c2d;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  width: 210px;
  max-height: 360px;
  overflow-y: auto;
  display: none;
  z-index: 110;
  padding: 6px;
}

[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

.lang-dropdown.active {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  text-decoration: none;
}

.lang-option:hover, .lang-option.active {
  background: rgba(239, 68, 68, 0.15);
  color: #fff;
  font-weight: 600;
}

/* AdSense Container */
.ad-slot-wrap {
  margin: 24px auto;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow: hidden;
}

.ad-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: inline-block;
}

.ad-placeholder {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero Section */
.hero {
  padding: 48px 0 32px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

/* Filter & Search Bar */
.controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 36px;
}

.search-box {
  position: relative;
  margin-bottom: 18px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

[dir="rtl"] .search-icon {
  left: auto;
  right: 16px;
}

.search-input {
  width: 100%;
  background: rgba(11, 15, 23, 0.7);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 14px 44px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.chip-btn:hover, .chip-btn.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
  font-weight: 600;
}

.select-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.custom-select {
  background: rgba(11, 15, 23, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.custom-select:focus {
  border-color: var(--accent-red);
}

/* Stats counter */
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.cars-count {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.cars-count span {
  color: var(--accent-red);
  font-size: 1.1rem;
}

/* Cars Grid */
.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 28px;
  margin-bottom: 60px;
}

.car-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.car-card:hover {
  transform: translateY(-6px);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

.card-media {
  position: relative;
  width: 100%;
  height: 220px;
  background: #0f172a;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}

.car-card:hover .card-img {
  transform: scale(1.06);
}

.rank-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 100px;
}

[dir="rtl"] .rank-pill {
  left: auto;
  right: 14px;
}

.era-pill {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 100px;
}

[dir="rtl"] .era-pill {
  right: auto;
  left: 14px;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.car-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
  color: #fff;
}

.car-badge {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 14px;
}

.specs-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(11, 15, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 16px;
  text-align: center;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-k {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.spec-v {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
}

.card-footer {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.btn-detail {
  width: 100%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
}

.btn-detail:hover {
  background: linear-gradient(135deg, var(--accent-red), var(--accent-red-hover));
  border-color: var(--accent-red);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

[dir="rtl"] .modal-close {
  right: auto;
  left: 18px;
}

.modal-close:hover {
  background: var(--accent-red);
}

.modal-header-media {
  position: relative;
  height: 360px;
  width: 100%;
}

.modal-header-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-media-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: linear-gradient(to top, #111827 0%, transparent 100%);
}

.modal-body {
  padding: 30px;
}

.modal-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.spec-box {
  background: #1a2234;
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: var(--radius-sm);
}

.spec-box-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.spec-box-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.section-h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 24px 0 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--accent-red);
  border-radius: 2px;
}

.highlights-list {
  list-style: none;
  margin-bottom: 24px;
}

.highlights-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

[dir="rtl"] .highlights-list li {
  padding-left: 0;
  padding-right: 24px;
}

.highlights-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--accent-gold);
}

[dir="rtl"] .highlights-list li::before {
  left: auto;
  right: 0;
}

.history-text {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 0.98rem;
  margin-bottom: 24px;
}

/* Footer */
.footer {
  background: #070a10;
  border-top: 1px solid var(--border-color);
  padding: 48px 0 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-desc {
  margin-top: 12px;
  max-width: 440px;
  line-height: 1.6;
}

.footer-col h4 {
  color: #fff;
  margin-bottom: 16px;
  font-size: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-red);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .cars-grid {
    grid-template-columns: 1fr;
  }
  .controls-panel {
    padding: 14px;
  }
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  .chip-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* === Cookie Consent & CMP Styles === */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 900px;
  width: calc(100% - 40px);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  z-index: 10000;
  display: none;
  animation: slideUp 0.4s ease-out;
}

.cookie-banner.active {
  display: block;
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.cookie-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.cookie-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.cookie-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
}

.cookie-text a {
  color: var(--accent-red);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-cookie-accept {
  background: var(--accent-red);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cookie-accept:hover {
  background: var(--accent-red-hover);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-cookie-reject {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cookie-reject:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-cookie-manage {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cookie-manage:hover {
  color: #fff;
  border-color: var(--accent-gold);
}

/* Cookie Settings Modal */
.cookie-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cookie-modal.active {
  display: flex;
}

.cookie-modal-card {
  background: #131b2a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  padding: 30px;
  box-shadow: var(--shadow-card);
}

.cookie-option-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.cookie-option-info h4 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 4px;
}

.cookie-option-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 24px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .cookie-slider {
  background-color: var(--accent-red);
}

input:checked + .cookie-slider:before {
  transform: translateX(20px);
}

input:disabled + .cookie-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Privacy Policy Layout */
.privacy-container {
  max-width: 900px;
  margin: 40px auto 80px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
}

.privacy-container h1 {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 8px;
}

.privacy-container h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 32px 0 14px;
  border-left: 4px solid var(--accent-red);
  padding-left: 12px;
}

[dir="rtl"] .privacy-container h2 {
  border-left: none;
  border-right: 4px solid var(--accent-red);
  padding-left: 0;
  padding-right: 12px;
}

.privacy-container p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
  font-size: 0.98rem;
}

.privacy-container ul {
  margin: 12px 0 20px 24px;
  color: var(--text-secondary);
}

[dir="rtl"] .privacy-container ul {
  margin: 12px 24px 20px 0;
}

.privacy-container li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.compliance-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
}
