@layer reset, tokens, base, layout, components, sections, utilities;

/* ========== RESET ========== */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; }
  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
  p { text-wrap: pretty; }
  h1, h2, h3, h4, h5, h6 { text-wrap: balance; }
  a { color: inherit; }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
}

/* ========== TOKENS ========== */
@layer tokens {
  @font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('../assets/fonts/space-grotesk.woff2') format('woff2');
  }
  @font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../assets/fonts/inter.woff2') format('woff2');
  }
  :root {
    --color-surface: #ffffff;
    --color-surface-alt: #f1f5f9;
    --color-text: #0c1829;
    --color-text-muted: #5a6578;
    --color-primary: #1a3a6b;
    --color-primary-hover: #122b52;
    --color-primary-light: #e8eef6;
    --color-primary-soft: #dbe4f0;
    --color-border: #dde3ed;
    --color-accent: #2563eb;
    --color-dark: #0f1e36;
    --color-dark-alt: #162a48;
    --color-success: #16a34a;
    --color-error: #dc2626;

    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --text-display: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
    --text-h1: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
    --text-h2: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
    --text-h3: clamp(1.2rem, 0.8rem + 0.8vw, 1.65rem);
    --text-body: clamp(1rem, 0.9rem + 0.3vw, 1.125rem);
    --text-sm: clamp(0.85rem, 0.8rem + 0.15vw, 0.9rem);

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: clamp(3rem, 6vw, 6rem);
    --space-section: clamp(4.5rem, 7vw, 7rem);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px -4px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 50px -8px rgba(0,0,0,0.18);

    --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 400ms;
  }
}

/* ========== BASE ========== */
@layer base {
  body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    color: var(--color-text);
    background-color: var(--color-surface);
    overflow-x: hidden;
  }
  h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--color-text);
  }
  h1 { font-size: var(--text-h1); }
  h2 { font-size: var(--text-h2); }
  h3 { font-size: var(--text-h3); }
  p { max-width: 65ch; line-height: 1.7; color: var(--color-text-muted); }
  a {
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color var(--duration-fast) var(--ease-out);
  }
  img { height: auto; border-radius: var(--radius-md); }
  section { padding-block: var(--space-section); }
  ::selection { background: var(--color-primary-light); color: var(--color-primary); }
}

/* ========== LAYOUT ========== */
@layer layout {
  .container { width: min(90%, 1200px); margin-inline: auto; padding-inline: var(--space-md); }
  .container--narrow { width: min(90%, 800px); margin-inline: auto; }
  .container--wide { width: min(95%, 1400px); margin-inline: auto; }
  .grid { display: grid; gap: var(--space-lg); }
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid--60-40 { grid-template-columns: 3fr 2fr; }
  .grid--40-60 { grid-template-columns: 2fr 3fr; }
  @media (max-width: 1024px) {
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 768px) {
    .grid--2, .grid--3, .grid--4,
    .grid--60-40, .grid--40-60 { grid-template-columns: 1fr; }
  }
}

/* ========== COMPONENTS ========== */
@layer components {

  /* --- Header & Nav --- */
  .site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
  }
  .scroll-progress {
    position: absolute; bottom: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--color-primary);
    transform-origin: left;
    animation: scroll-progress linear;
    animation-timeline: scroll();
  }
  @keyframes scroll-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @supports not (animation-timeline: scroll()) { .scroll-progress { display: none; } }

  .nav {
    display: flex; align-items: center; justify-content: space-between;
    padding-block: var(--space-sm); min-height: 70px;
  }
  .nav__logo { text-decoration: none; display: flex; align-items: center; }
  .nav__logo img {
    height: 42px; width: auto; border-radius: 0;
    filter: brightness(0) saturate(100%) invert(15%) sepia(40%) saturate(1200%) hue-rotate(195deg);
  }
  .nav__menu { display: flex; align-items: center; gap: var(--space-xl); list-style: none; padding: 0; }
  .nav__link {
    text-decoration: none; color: var(--color-text-muted);
    font-weight: 500; padding-block: var(--space-xs);
    position: relative; transition: color var(--duration-fast) var(--ease-out);
  }
  .nav__link::after {
    content: ''; position: absolute; bottom: -2px; left: 0;
    width: 100%; height: 2px; background: var(--color-primary);
    transform: scaleX(0); transform-origin: left;
    transition: transform var(--duration-base) var(--ease-smooth);
  }
  .nav__link:hover, .nav__link.active { color: var(--color-text); }
  .nav__link:hover::after, .nav__link.active::after { transform: scaleX(1); }

  section[id] { scroll-margin-top: 5rem; }

  .nav__toggle { display: none; background: none; border: none; cursor: pointer; padding: var(--space-sm); z-index: 200; }
  .hamburger { display: flex; flex-direction: column; gap: 5px; width: 24px; }
  .hamburger__line {
    display: block; width: 100%; height: 2px;
    background: var(--color-text); border-radius: 2px;
    transition: transform var(--duration-base) var(--ease-smooth), opacity var(--duration-fast);
    transform-origin: center;
  }
  .nav__toggle[aria-expanded="true"] .hamburger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .hamburger__line:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] .hamburger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  @media (max-width: 768px) {
    .site-header {
      background: #fff;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }
    .nav__toggle { display: block; }
    .nav__menu {
      position: fixed; inset: 0;
      background: #fff;
      padding: 6rem var(--space-xl) var(--space-xl);
      flex-direction: column; align-items: center;
      gap: var(--space-xl);
      transform: translateX(100%);
      transition: transform var(--duration-slow) var(--ease-smooth);
      z-index: 100;
    }
    .nav__menu.is-open { transform: translateX(0); }
    .nav__menu .nav__link { font-size: var(--text-h3); }
  }

  /* --- Buttons --- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--space-sm); padding: 0.8em 2em;
    font-family: var(--font-body); font-size: var(--text-body);
    font-weight: 600; text-decoration: none;
    border: 2px solid transparent; border-radius: var(--radius-md);
    cursor: pointer; min-height: 48px;
    transition: all var(--duration-base) var(--ease-smooth);
  }
  .btn--primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
  .btn--primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .btn--primary:active { transform: translateY(0); }
  .btn--secondary { background: transparent; color: var(--color-text); border-color: var(--color-border); }
  .btn--secondary:hover { border-color: var(--color-text); background: var(--color-surface-alt); }
  .btn--white { background: #fff; color: var(--color-primary); border-color: #fff; }
  .btn--white:hover { background: var(--color-surface-alt); transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .btn--ghost-white { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
  .btn--ghost-white:hover { background: rgba(255,255,255,0.1); border-color: #fff; }
  .btn--sm { padding: 0.55em 1.3em; font-size: var(--text-sm); min-height: 40px; }
  .btn--lg { padding: 1em 2.5em; font-size: calc(var(--text-body) * 1.05); min-height: 54px; }
  .btn--block { width: 100%; }
  .btn--magnetic { transition: transform 0.15s ease, box-shadow var(--duration-base) var(--ease-smooth), background var(--duration-base), border-color var(--duration-base); }

  /* --- Forms --- */
  .form-group { display: flex; flex-direction: column; gap: var(--space-xs); }
  .form-label { font-weight: 500; font-size: var(--text-sm); color: var(--color-text); }
  .form-input, .form-textarea {
    width: 100%; padding: 0.85em 1.1em;
    font: inherit; color: var(--color-text);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  }
  .form-input::placeholder, .form-textarea::placeholder { color: var(--color-text-muted); opacity: 0.6; }
  .form-input:focus, .form-textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-light); }
  .form-textarea { resize: vertical; min-height: 140px; }
  .form-success {
    padding: var(--space-xl);
    background: #f0fdf4;
    border: 2px solid var(--color-success);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--color-success);
    font-weight: 600;
    font-size: var(--text-body);
  }

  /* --- Effects --- */
  [data-reveal] { opacity: 0; transform: translateY(30px); transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth); }
  [data-reveal="left"] { transform: translateX(-40px); }
  [data-reveal="right"] { transform: translateX(40px); }
  [data-reveal="scale"] { transform: scale(0.92); }
  .revealed { opacity: 1; transform: translate(0) scale(1); }

  .stagger-item { opacity: 0; transform: translateY(24px); transition: opacity 0.5s ease, transform 0.5s ease; transition-delay: calc(var(--i, 0) * 100ms); }
  .stagger-item.is-visible { opacity: 1; transform: translateY(0); }

  .divider-wave { position: relative; }
  .divider-wave::after {
    content: ''; position: absolute; bottom: -1px; left: 0;
    width: 100%; height: 70px;
    background: var(--divider-bg, var(--color-surface));
    clip-path: ellipse(55% 100% at 50% 100%); z-index: 2;
  }
  .divider-diagonal { position: relative; }
  .divider-diagonal::after {
    content: ''; position: absolute; bottom: -1px; left: 0;
    width: 100%; height: 90px;
    background: var(--divider-bg, var(--color-surface));
    clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%); z-index: 2;
  }

  .has-grain::before {
    content: ''; position: fixed; inset: 0;
    z-index: 9999; pointer-events: none; opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  .parallax-img { overflow: hidden; border-radius: var(--radius-lg); }
  .parallax-img img { animation: parallax-scroll linear; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  @keyframes parallax-scroll { from { transform: translateY(-8%); scale: 1.15; } to { transform: translateY(8%); scale: 1.15; } }
  @supports not (animation-timeline: view()) { .parallax-img img { animation: none; } }

  .img-overlay { position: relative; overflow: hidden; }
  .img-overlay::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent 55%);
    border-radius: inherit; pointer-events: none;
  }

  .card--lift { transition: transform 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth); }
  .card--lift:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); }
  .card--lift img { transition: transform 0.5s var(--ease-smooth); }
  .card--lift:hover img { transform: scale(1.05); }

  .hero__accent { display: block; width: 60px; height: 4px; background: var(--color-accent); margin-bottom: var(--space-lg); border-radius: 2px; }

  /* --- Lightbox --- */
  .lightbox { border: none; background: rgba(0,0,0,0.92); max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; padding: 0; margin: 0; inset: 0; }
  .lightbox[open] { display: flex; align-items: center; justify-content: center; }
  .lightbox::backdrop { background: rgba(0,0,0,0.92); }
  .lightbox__img { max-width: 80vw; max-height: 85vh; object-fit: contain; border-radius: var(--radius-md); position: relative; z-index: 1; }
  .lightbox__close { position: fixed; top: 1rem; right: 1rem; background: rgba(255,255,255,0.18); border: none; color: #fff; font-size: 2rem; cursor: pointer; z-index: 9999; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; opacity: 0.85; transition: opacity 0.2s, background 0.2s; }
  .lightbox__close:hover { opacity: 1; background: rgba(255,255,255,0.3); }
  .lightbox__prev, .lightbox__next { position: fixed; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.3); color: #fff; font-size: 1.8rem; cursor: pointer; z-index: 9999; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 50%; opacity: 0.9; transition: opacity 0.2s, background 0.2s; }
  .lightbox__prev { left: 1.5rem; }
  .lightbox__next { right: 1.5rem; }
  .lightbox__prev:hover, .lightbox__next:hover { opacity: 1; background: rgba(255,255,255,0.35); }
  .lightbox__counter { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.85); font-size: 0.95rem; font-family: var(--font-heading); letter-spacing: 0.05em; background: rgba(0,0,0,0.5); padding: 0.35em 1.2em; border-radius: 2em; z-index: 9999; }
  @media (max-width: 600px) {
    .lightbox__prev, .lightbox__next { width: 44px; height: 44px; font-size: 1.4rem; }
    .lightbox__prev { left: 0.5rem; }
    .lightbox__next { right: 0.5rem; }
    .lightbox__img { max-width: 95vw; }
  }

  @media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    .stagger-item { opacity: 1; transform: none; transition: none; }
    .parallax-img img { animation: none; }
    .card--lift, .card--lift img { transition: none; }
    .card--lift:hover { transform: none; }
    .card--lift:hover img { transform: none; }
    .has-grain::before { display: none; }
  }
}

/* ========== SECTIONS ========== */
@layer sections {

  /* --- Section utilities --- */
  .section-header { margin-bottom: var(--space-2xl); }
  .section-header h2 { margin-bottom: var(--space-sm); }
  .section-header p { max-width: 55ch; }
  .section-label {
    display: inline-block;
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--space-sm);
    padding: 0.3em 0.9em;
    background: var(--color-primary-light);
    border-radius: var(--radius-full);
  }

  /* --- Hero (Fullscreen) --- */
  .hero {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--color-dark);
    color: #fff;
  }
  .hero__bg {
    position: absolute; inset: 0;
  }
  .hero__bg img {
    width: 100%; height: 100%;
    object-fit: cover; border-radius: 0;
  }
  .hero__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(135deg,
      rgba(15,30,54,0.92) 0%,
      rgba(15,30,54,0.75) 40%,
      rgba(15,30,54,0.4) 100%
    );
  }
  .hero .container {
    position: relative; z-index: 2;
    padding-block: clamp(4rem, 8vw, 7rem);
  }
  .hero__content { max-width: 640px; }
  .hero h1 {
    font-size: var(--text-display);
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin-bottom: var(--space-lg);
  }
  .hero p {
    color: rgba(255,255,255,0.8);
    font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.2rem);
    max-width: 50ch;
    margin-bottom: var(--space-xl);
  }
  .hero__actions { display: flex; gap: var(--space-md); flex-wrap: wrap; }
  .hero__accent { background: var(--color-accent); }
  .hero__badge {
    display: inline-flex; align-items: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-full);
    font-size: var(--text-sm); color: rgba(255,255,255,0.85);
    margin-top: var(--space-2xl);
  }
  .hero__badge strong { color: #fff; }

  /* --- Process Steps --- */
  .process-step {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    position: relative;
  }
  .process-step__number {
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px;
    margin: 0 auto var(--space-lg);
    background: var(--color-primary); color: #fff;
    font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 12px rgba(26,58,107,0.3);
  }
  .process-step h3 { font-size: 1.15rem; margin-bottom: var(--space-sm); }
  .process-step p { margin-inline: auto; font-size: var(--text-sm); }
  @media (min-width: 1025px) {
    .process-step:not(:last-child)::after {
      content: ''; position: absolute;
      top: 50px; right: -14px;
      width: 28px; height: 2px;
      background: var(--color-border); z-index: 3;
    }
  }

  /* --- Trust Cards --- */
  .trust-card {
    display: flex; gap: var(--space-lg);
    padding: var(--space-xl);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
  }
  .trust-card__icon {
    flex-shrink: 0; width: 60px; height: 60px;
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-primary);
  }
  .trust-card__icon svg { width: 28px; height: 28px; }
  .trust-card h3 { font-size: 1.1rem; margin-bottom: var(--space-xs); }
  .trust-card p { font-size: var(--text-sm); }

  /* --- Vehicle Cards (grid on index) --- */
  .vehicle-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex; flex-direction: column;
  }
  .vehicle-card__img {
    aspect-ratio: 16/10; overflow: hidden; position: relative;
  }
  .vehicle-card__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
  .vehicle-card__badge {
    position: absolute; top: var(--space-md); left: var(--space-md);
    background: var(--color-success); color: #fff;
    padding: 0.3em 0.85em; border-radius: var(--radius-full);
    font-size: var(--text-sm); font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1;
  }
  .vehicle-card__badge--sold { background: var(--color-text-muted); }
  .vehicle-card__body { padding: var(--space-lg); flex: 1; display: flex; flex-direction: column; }
  .vehicle-card__title {
    font-family: var(--font-display); font-size: 1.1rem;
    font-weight: 600; margin-bottom: var(--space-sm); line-height: 1.3;
  }
  .vehicle-card__price {
    font-family: var(--font-display); font-size: var(--text-h3);
    font-weight: 700; color: var(--color-primary);
    margin-bottom: var(--space-md);
  }
  .vehicle-card__specs {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: var(--space-xs) var(--space-md);
    padding-top: var(--space-md); border-top: 1px solid var(--color-border);
    margin-top: auto;
  }
  .vehicle-card__spec {
    display: flex; align-items: center; gap: var(--space-xs);
    font-size: var(--text-sm); color: var(--color-text-muted);
  }
  .vehicle-card__spec svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--color-primary); }
  .vehicle-card__actions { margin-top: var(--space-lg); }
  .vehicle-card__desc {
    font-size: var(--text-sm); color: var(--color-text-muted);
    margin-bottom: var(--space-md);
  }

  /* --- Vehicles Grid (nabidka card list) --- */
  .vehicles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
  }
  .vehicle-card__link {
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column; height: 100%;
  }
  .vehicle-card__link:hover .vehicle-card__img img {
    transform: scale(1.05);
  }
  .vehicle-card__link .vehicle-card__img img {
    transition: transform 0.4s ease;
  }
  @media (max-width: 900px) {
    .vehicles-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
  }
  @media (max-width: 580px) {
    .vehicles-grid { grid-template-columns: 1fr; }
  }

  /* --- Vehicle Detail Card (nabidka horizontal — legacy) --- */
  .vehicle-card--detail {
    flex-direction: row;
    margin-bottom: var(--space-2xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
  }
  .vehicle-card--detail .vehicle-card__img {
    flex: 0 0 44%; max-width: 44%;
    aspect-ratio: auto;
  }
  .vehicle-card--detail .vehicle-card__img img { min-height: 320px; }
  .vehicle-card--detail .vehicle-card__body { flex: 1; padding: var(--space-xl); }
  .vehicle-card--detail .vehicle-card__title { font-size: var(--text-h3); }
  .vehicle-card--detail .vehicle-card__specs { grid-template-columns: repeat(3, 1fr); }
  .vehicle-card--detail .gallery-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm);
  }
  @media (max-width: 900px) {
    .vehicle-card--detail { flex-direction: column; }
    .vehicle-card--detail .vehicle-card__img { flex: auto; max-width: 100%; }
    .vehicle-card--detail .vehicle-card__img img { min-height: 200px; }
    .vehicle-card--detail .vehicle-card__specs { grid-template-columns: repeat(2, 1fr); }
    .vehicle-card--detail .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 480px) {
    .vehicle-card--detail .vehicle-card__img img { min-height: 180px; }
    .vehicle-card--detail .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }
    .gallery-grid a { aspect-ratio: 3/2; }
  }

  /* --- Vehicle Detail Page (vozidlo.html) --- */
  .vehicle-detail-section { padding: var(--space-2xl) 0 var(--space-3xl); }
  .vehicle-detail-loading {
    text-align: center; padding: var(--space-3xl) 0;
    font-size: var(--text-lg); color: var(--color-text-muted);
  }
  .vehicle-detail {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-md);
  }
  .vehicle-detail__main-img {
    position: relative; border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .vehicle-detail__main-img img {
    width: 100%; height: auto; display: block;
    border-radius: var(--radius-lg);
  }
  .vehicle-card__badge--lg {
    font-size: 1rem; padding: 0.5em 1.2em;
  }
  .vehicle-detail__info {
    display: flex; flex-direction: column;
  }
  .vehicle-detail__title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700; line-height: 1.2;
    margin-bottom: var(--space-sm);
  }
  .vehicle-detail__equipment {
    font-size: var(--text-base); color: var(--color-text);
    margin-bottom: var(--space-sm);
    line-height: 1.7;
  }
  .vehicle-detail__equipment strong {
    color: var(--color-primary);
  }
  .vehicle-detail__desc {
    font-size: var(--text-base); color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
    white-space: pre-line;
  }
  .vehicle-detail__price {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700; color: var(--color-primary);
    margin-bottom: var(--space-xl);
  }
  .vehicle-detail__specs {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--color-surface-alt);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
  }
  .vehicle-detail__spec {
    display: flex; align-items: flex-start; gap: var(--space-sm);
    font-size: var(--text-sm);
  }
  .vehicle-detail__spec svg {
    width: 20px; height: 20px; flex-shrink: 0;
    color: var(--color-primary); margin-top: 2px;
  }
  .spec-label {
    display: block; font-size: 0.75rem;
    color: var(--color-text-muted); text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .spec-value {
    display: block; font-weight: 600;
    font-size: var(--text-base); color: var(--color-text);
  }
  .vehicle-detail__actions {
    display: flex; gap: var(--space-md);
    margin-top: auto;
  }
  .vehicle-detail__gallery {
    margin-bottom: var(--space-2xl);
  }
  .vehicle-detail__gallery h3 {
    font-family: var(--font-display);
    font-size: var(--text-h3); margin-bottom: var(--space-lg);
  }
  .gallery-grid--detail {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
  }
  .gallery-grid--detail a {
    aspect-ratio: 4/3; overflow: hidden;
    border-radius: var(--radius-md);
  }
  .gallery-grid--detail img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s ease;
  }
  .gallery-grid--detail a:hover img { transform: scale(1.05); }
  .vehicle-detail__back {
    text-align: center; padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
  }
  .vehicle-detail__empty {
    text-align: center; padding: var(--space-3xl) 0;
  }
  .vehicle-detail__empty h2 { margin-bottom: var(--space-md); }
  .vehicle-detail__empty p { color: var(--color-text-muted); margin-bottom: var(--space-xl); }

  @media (max-width: 900px) {
    .vehicle-detail { grid-template-columns: 1fr; }
    .vehicle-detail__specs { grid-template-columns: 1fr 1fr; }
    .gallery-grid--detail { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 580px) {
    .vehicle-detail__actions { flex-direction: column; }
    .vehicle-detail__specs { grid-template-columns: 1fr; }
    .gallery-grid--detail { grid-template-columns: repeat(2, 1fr); }
  }

  /* --- Stats --- */
  .stats {
    background: var(--color-dark);
    color: #fff;
    padding-block: clamp(3.5rem, 5vw, 5rem);
  }
  .stat { text-align: center; padding: var(--space-lg); }
  .stat__number {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 2rem + 2vw, 4rem);
    font-weight: 700; color: #fff;
    line-height: 1;
  }
  .stat__label {
    display: block; margin-top: var(--space-sm);
    font-size: var(--text-sm); color: rgba(255,255,255,0.55);
    text-transform: uppercase; letter-spacing: 0.08em;
  }
  .stat--text .stat__number {
    font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.2rem);
  }

  /* --- CTA --- */
  .cta {
    background: var(--color-primary);
    color: #fff;
    text-align: center;
    padding-block: clamp(4.5rem, 8vw, 8rem);
    position: relative;
    overflow: hidden;
  }
  .cta::before {
    content: '';
    position: absolute; top: -50%; right: -20%; width: 50%; height: 200%;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
  }
  .cta .container { position: relative; z-index: 1; }
  .cta h2 { color: #fff; margin-bottom: var(--space-md); }
  .cta p { color: rgba(255,255,255,0.8); margin-inline: auto; margin-bottom: var(--space-xl); }

  /* --- Footer --- */
  .site-footer {
    background: var(--color-dark);
    color: rgba(255,255,255,0.7);
    padding-top: clamp(3.5rem, 6vw, 5rem);
  }
  .site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: var(--space-md); }
  .site-footer ul { list-style: none; padding: 0; }
  .site-footer li { margin-bottom: var(--space-sm); }
  .site-footer a { color: rgba(255,255,255,0.65); text-decoration: none; transition: color var(--duration-fast); }
  .site-footer a:hover { color: #fff; }
  .site-footer__logo img { height: 40px; width: auto; margin-bottom: var(--space-md); border-radius: 0; filter: none; }
  .site-footer__brand p { font-size: var(--text-sm); max-width: 30ch; }
  .site-footer__contact p { font-size: var(--text-sm); margin-bottom: var(--space-sm); }
  .site-footer__contact a { color: rgba(255,255,255,0.85); }
  .site-footer__bottom {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: var(--space-2xl); padding-block: var(--space-lg);
  }
  .site-footer__bottom p { font-size: var(--text-sm); color: rgba(255,255,255,0.35); }

  /* --- Page Hero (subpages) --- */
  .page-hero {
    background: var(--color-dark); color: #fff;
    padding-block: clamp(3.5rem, 6vw, 6rem);
    text-align: center;
  }
  .page-hero h1 { color: #fff; margin-bottom: var(--space-sm); }
  .page-hero p { color: rgba(255,255,255,0.7); margin-inline: auto; }
  .page-hero .hero__accent { margin-inline: auto; }

  /* --- Breadcrumb --- */
  .breadcrumb {
    background: var(--color-surface-alt);
    padding-block: var(--space-md);
    border-bottom: 1px solid var(--color-border);
  }
  .breadcrumb__list {
    display: flex; gap: var(--space-sm); align-items: center;
    list-style: none; padding: 0;
    font-size: var(--text-sm); color: var(--color-text-muted);
  }
  .breadcrumb__list a { color: var(--color-primary); text-decoration: none; }
  .breadcrumb__list a:hover { text-decoration: underline; }

  /* --- Contact --- */
  .contact-section { padding-block: var(--space-section); }
  .contact-form { max-width: 640px; display: flex; flex-direction: column; gap: var(--space-lg); }
  .contact-info-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
  }
  .contact-info-card {
    padding: var(--space-xl);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
  }
  .contact-info-card svg { width: 32px; height: 32px; color: var(--color-primary); margin: 0 auto var(--space-md); }
  .contact-info-card h3 { font-size: 1rem; margin-bottom: var(--space-xs); }
  .contact-info-card p { font-size: var(--text-sm); margin-inline: auto; }
  .contact-info-card a { color: var(--color-primary); text-decoration: none; font-weight: 500; }
  .contact-info-card a:hover { text-decoration: underline; }
  .map-container { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/9; box-shadow: var(--shadow-md); }
  .map-container iframe { width: 100%; height: 100%; border: 0; }

  /* --- Gallery Grid --- */
  .gallery-grid a {
    display: block; overflow: hidden;
    border-radius: var(--radius-sm);
    aspect-ratio: 4/3;
  }
  .gallery-grid img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.4s var(--ease-smooth);
    border-radius: 0;
  }
  .gallery-grid a:hover img { transform: scale(1.08); }

  /* --- Legal text --- */
  .legal-text {
    font-size: var(--text-sm); color: var(--color-text-muted);
    max-width: 80ch; margin-top: var(--space-2xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
  }

  /* --- Custom CTA Box (nabidka) --- */
  .cta-box {
    padding: var(--space-2xl);
    background: var(--color-surface-alt);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--color-border);
  }
  .cta-box h3 { margin-bottom: var(--space-sm); }
  .cta-box p { margin-inline: auto; margin-bottom: var(--space-lg); }

  /* --- Archive --- */
  .archive-filters {
    padding-block: var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: 70px; z-index: 50;
  }
  .archive-filters__bar {
    display: flex; flex-wrap: wrap; gap: var(--space-sm);
    align-items: center;
  }
  .archive-filters__group { flex: 1; min-width: 140px; }
  .archive-filter__select,
  .archive-filter__input {
    width: 100%; padding: 0.6em 1em;
    font: inherit; font-size: var(--text-sm);
    color: var(--color-text);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-fast);
    appearance: none;
    cursor: pointer;
  }
  .archive-filter__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6578' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8em center;
    padding-right: 2.2em;
  }
  .archive-filter__input { cursor: text; }
  .archive-filter__select:focus,
  .archive-filter__input:focus {
    outline: none; border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
  }
  .archive-count {
    font-size: var(--text-sm); color: var(--color-text-muted);
    margin-top: var(--space-sm);
  }

  .archive-section { padding-block: var(--space-2xl) var(--space-section); }
  .archive-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
  }
  .archive-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex; flex-direction: column;
  }
  .archive-card[hidden] { display: none; }
  .archive-card__img {
    position: relative; overflow: hidden;
    aspect-ratio: 16/10;
  }
  .archive-card__img img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 0;
  }
  .archive-card__num {
    display: none;
  }
  .archive-card .vehicle-card__badge,
  .archive-card .vehicle-card__badge--sold {
    position: absolute; top: var(--space-sm); left: var(--space-sm);
    z-index: 1;
  }
  .archive-card__body {
    padding: var(--space-md); flex: 1;
    display: flex; flex-direction: column;
  }
  .archive-card__title {
    font-family: var(--font-display);
    font-size: 0.92rem; font-weight: 600;
    line-height: 1.3; margin-bottom: var(--space-sm);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .archive-card__specs {
    display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm);
    font-size: 0.78rem; color: var(--color-text-muted);
    margin-top: auto;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
  }
  .archive-card__specs span:not(:last-child)::after {
    content: '·'; margin-left: var(--space-sm); color: var(--color-border);
  }
  .archive-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-3xl);
    color: var(--color-text-muted);
  }

  @media (max-width: 1200px) {
    .archive-grid { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 900px) {
    .archive-grid { grid-template-columns: repeat(2, 1fr); }
    .archive-filters__bar { gap: var(--space-sm); }
    .archive-filters__group { min-width: 120px; }
  }
  @media (max-width: 550px) {
    .archive-grid { grid-template-columns: 1fr; }
    .archive-filters { position: static; }
  }

  /* --- Vehicle actions wrap --- */
  .vehicle-card__actions {
    display: flex; flex-wrap: wrap; gap: var(--space-sm);
  }

  /* --- Responsive --- */
  @media (max-width: 768px) {
    .hero { min-height: 80vh; }
    .hero h1 { font-size: clamp(1.8rem, 1.2rem + 3vw, 2.8rem); }
    .hero__badge { font-size: 0.78rem; text-align: center; flex-wrap: wrap; justify-content: center; }
    .trust-card { flex-direction: column; text-align: center; }
    .trust-card__icon { margin: 0 auto; }
    .site-footer .grid--4 { grid-template-columns: repeat(2, 1fr); gap: var(--space-2xl); }
    .site-footer__bottom { flex-direction: column; gap: var(--space-md); text-align: center; }
    .vehicle-card--detail .vehicle-card__specs { grid-template-columns: 1fr 1fr; }
    .vehicle-card--detail .vehicle-card__actions .btn { width: 100%; }
    .vehicle-card__spec { font-size: 0.8rem; word-break: break-all; }
    .contact-form { gap: var(--space-md); }
  }
  @media (max-width: 480px) {
    .site-footer .grid--4 { grid-template-columns: 1fr; }
    .hero__actions { flex-direction: column; }
    .hero__actions .btn { width: 100%; }
    .hero__badge { padding: var(--space-sm) var(--space-md); }
    .vehicle-card--detail .vehicle-card__specs { grid-template-columns: 1fr; }
    .vehicle-card__price { font-size: 1.3rem; }
    .stats .grid--4 { gap: 0; }
    .stat { padding: var(--space-md); }
    .stat__number { font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); }
    .process-step { padding: var(--space-xl) var(--space-md); }
    .contact-info-grid { grid-template-columns: 1fr; }
  }
}

/* ========== UTILITIES ========== */
@layer utilities {
  .sr-only, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .skip-link { position: absolute; top: -100%; left: var(--space-md); background: var(--color-primary); color: #fff; padding: var(--space-sm) var(--space-md); border-radius: 0 0 var(--radius-md) var(--radius-md); z-index: 999; transition: top var(--duration-fast); text-decoration: none; font-weight: 600; }
  .skip-link:focus { top: 0; }
  :focus { outline: none; }
  :focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: 2px; }
  .text-muted { color: var(--color-text-muted); }
  .text-center { text-align: center; }
  .text-sm { font-size: var(--text-sm); }
  .bg-alt { background-color: var(--color-surface-alt); }
  .mt-sm { margin-top: var(--space-sm); }
  .mt-md { margin-top: var(--space-md); }
  .mt-lg { margin-top: var(--space-lg); }
  .mt-xl { margin-top: var(--space-xl); }
  .mb-sm { margin-bottom: var(--space-sm); }
  .mb-md { margin-bottom: var(--space-md); }
  .mb-lg { margin-bottom: var(--space-lg); }
  .mb-xl { margin-bottom: var(--space-xl); }
  .flex { display: flex; }
  .gap-sm { gap: var(--space-sm); }
  .gap-md { gap: var(--space-md); }
  .gap-lg { gap: var(--space-lg); }
  .gap-xl { gap: var(--space-xl); }
  .gap-2xl { gap: var(--space-2xl); }
  /* --- Cookie consent --- */
  .cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--color-dark);
    color: rgba(255,255,255,0.85);
    padding: var(--space-lg) var(--space-xl);
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-smooth);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  }
  .cookie-banner.visible { transform: translateY(0); }
  .cookie-banner__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-lg); flex-wrap: wrap;
    max-width: 1200px; margin-inline: auto;
  }
  .cookie-banner__text { flex: 1; min-width: 280px; font-size: var(--text-sm); line-height: 1.5; }
  .cookie-banner__text a { color: rgba(255,255,255,0.9); text-decoration: underline; }
  .cookie-banner__actions { display: flex; gap: var(--space-sm); flex-shrink: 0; }

  /* --- Admin link in footer --- */
  .admin-link {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.2) !important;
    text-decoration: none;
    transition: color 0.2s;
  }
  .admin-link:hover { color: rgba(255,255,255,0.5) !important; }

  /* --- Privacy page --- */
  .privacy-content h2 { font-size: var(--text-h3); margin-top: var(--space-2xl); margin-bottom: var(--space-md); }
  .privacy-content h2:first-child { margin-top: 0; }
  .privacy-content p { margin-bottom: var(--space-md); }
  .privacy-content ul { margin-bottom: var(--space-md); padding-left: var(--space-xl); color: var(--color-text-muted); }
  .privacy-content li { margin-bottom: var(--space-xs); }
  .privacy-content a { color: var(--color-primary); }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  }
}
