/* FindEdition Autos Enterprise Design System — Platform 21.2.2 */
:root {
  --au-primary: #059669;
  --au-primary-dark: #047857;
  --au-accent: #0d9488;
  --au-surface: #ffffff;
  --au-surface-2: #f8fafc;
  --au-border: #e2e8f0;
  --au-text: #0f172a;
  --au-muted: #64748b;
  --au-radius: 1rem;
  --au-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --au-shadow-hover: 0 12px 40px rgba(5, 150, 105, 0.15);
}

.autos-theme { color: var(--au-text); background: var(--au-surface-2); }
.au-container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }

/* Navigation */
.au-nav { display: flex; flex-wrap: wrap; gap: .375rem .5rem; margin-bottom: 1.5rem; }
.au-nav a {
  padding: .5rem 1rem; border-radius: 999px; font-size: .8125rem; font-weight: 600;
  color: var(--au-muted); border: 1px solid var(--au-border); background: var(--au-surface);
  text-decoration: none; transition: all .2s; white-space: nowrap;
}
.au-nav a:hover { color: var(--au-primary-dark); border-color: var(--au-primary); background: color-mix(in srgb, var(--au-primary) 10%, var(--au-surface)); }
.au-nav a.is-active { color: #fff; border-color: var(--au-primary); background: var(--au-primary); }
.au-nav-end { justify-content: flex-end; margin-left: auto; }

/* Page toolbar — detail page only: breadcrumb left, nav right */
.au-page-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem 1.25rem; padding: .75rem 0 .5rem; width: 100%;
}
.au-page-toolbar-start { flex: 1 1 auto; min-width: 0; }
.au-page-toolbar-start .au-breadcrumb-bar { padding: 0; }
.au-page-toolbar-end { flex: 0 1 auto; margin-left: auto; }
.au-page-toolbar-end .au-nav { margin-bottom: 0; }
@media (min-width: 768px) {
  .au-nav a { font-size: .875rem; padding: .5rem 1.125rem; }
}
@media (max-width: 767px) {
  .au-page-toolbar { flex-direction: column; align-items: stretch; }
  .au-page-toolbar-end { margin-left: 0; width: 100%; }
  .au-page-toolbar-end .au-nav { justify-content: flex-end; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; -webkit-overflow-scrolling: touch; }
}

/* Hero nav — on green gradient (autos index) */
.au-nav-hero {
  justify-content: center;
  margin-bottom: 1.25rem;
  gap: 0.5rem 0.625rem;
  width: 100%;
}
.au-nav-hero a {
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.625rem 1.125rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.au-nav-hero a:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.24);
}
.au-nav-hero a.is-active {
  color: var(--au-primary-dark);
  background: #fff;
  border-color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
@media (min-width: 768px) {
  .au-nav-hero { gap: 0.625rem 0.875rem; margin-bottom: 1.5rem; }
  .au-nav-hero a { font-size: 1rem; padding: 0.75rem 1.375rem; }
}

/* Cards */
.au-vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.au-vehicle-card {
  background: var(--au-surface); border: 1px solid var(--au-border); border-radius: var(--au-radius);
  overflow: hidden; box-shadow: var(--au-shadow); transition: transform .2s, box-shadow .2s;
  text-decoration: none; color: inherit; display: block;
}
.au-vehicle-card:hover { transform: translateY(-4px); box-shadow: var(--au-shadow-hover); }
.au-vehicle-card-image { position: relative; aspect-ratio: 16/10; background: var(--au-surface-2); overflow: hidden; }
.au-vehicle-card-image img { width: 100%; height: 100%; object-fit: cover; }
.au-vehicle-card-body { padding: 1rem; }
.au-vehicle-title { font-weight: 700; font-size: 1rem; margin: 0 0 .25rem; }
.au-vehicle-subtitle { font-size: .8125rem; color: var(--au-muted); margin: 0 0 .75rem; }
.au-vehicle-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.au-price { font-weight: 700; color: var(--au-primary); font-size: .9375rem; }
.au-price-na { color: var(--au-muted); font-weight: 500; }
.au-rating { color: #d97706; font-size: .8125rem; font-weight: 600; }

/* Compare button on cards */
.au-compare-btn {
  position: absolute; top: .5rem; right: .5rem; z-index: 2;
  width: 2rem; height: 2rem; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--au-primary); box-shadow: 0 2px 8px rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: center;
}
.au-compare-btn.is-added { background: var(--au-primary); color: #fff; }

/* Badges */
.au-badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .6875rem; font-weight: 700; text-transform: uppercase; }
.au-badge-featured { background: #fef3c7; color: #92400e; }
.au-badge-brand { background: #ecfdf5; color: var(--au-primary-dark); }

/* Dark mode — opt-in toggle + system preference */
.autos-theme.au-dark,
html.dark .autos-theme {
  --au-surface: #1e293b;
  --au-surface-2: #0f172a;
  --au-border: #334155;
  --au-text: #f1f5f9;
  --au-muted: #94a3b8;
  --au-shadow: 0 4px 24px rgba(0,0,0,.25);
  --au-shadow-hover: 0 12px 40px rgba(5,150,105,.2);
}
.autos-theme.au-dark .au-nav a:hover,
html.dark .autos-theme .au-nav a:hover {
  background: rgba(5,150,105,.2);
  color: #6ee7b7;
}
.autos-theme.au-dark .au-nav a.is-active,
html.dark .autos-theme .au-nav a.is-active {
  background: var(--au-primary);
  color: #fff;
  border-color: var(--au-primary);
}
.autos-theme.au-dark .au-vehicle-card-image,
html.dark .autos-theme .au-vehicle-card-image { background: #334155; }
.autos-theme.au-dark .au-badge-brand,
html.dark .autos-theme .au-badge-brand { background: rgba(5,150,105,.2); }
@media (prefers-color-scheme: dark) {
  .autos-theme.dark-auto:not(.au-dark) {
    --au-surface: #1e293b; --au-surface-2: #0f172a; --au-border: #334155;
    --au-text: #f1f5f9; --au-muted: #94a3b8;
  }
}
