/* =========================================================
   Ebner Abschlepptechnik – Stylesheet
   Farben aus logo_ebner.svg abgeleitet (#035A9C / #1a1a1a)
   ========================================================= */

:root {
  --color-primary: #035a9c;
  --color-primary-dark: #023d6b;
  --color-primary-darker: #012840;
  --color-primary-light: #e8f1f8;
  --color-primary-light-2: #d3e6f5;
  --color-accent: #0678c9;
  --color-dark: #14181c;
  --color-text: #2b333a;
  --color-gray: #5a6570;
  --color-gray-light: #f5f7f9;
  --color-border: #e3e8ed;
  --color-white: #ffffff;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 10px rgba(2, 40, 64, 0.06);
  --shadow: 0 10px 30px rgba(2, 40, 64, 0.1);
  --shadow-lg: 0 20px 50px rgba(2, 40, 64, 0.16);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --header-height: 84px;
  --container-width: 1180px;
}

/* ---------- Reset & Base ---------- */
* ,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  max-width: 100vw;
}

h1, h2, h3, h4, p {
  overflow-wrap: break-word;
  word-break: break-word;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

h1, h2, h3, h4 {
  font-family: inherit;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-dark);
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; }

ul { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin-bottom: 0.4em; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 88px 0;
}

@media (max-width: 700px) {
  section { padding: 56px 0; }
}

.section-tight { padding: 48px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--color-primary);
  display: inline-block;
}

.lead {
  font-size: 1.15rem;
  color: var(--color-gray);
  max-width: 640px;
}

.bg-light {
  background: var(--color-gray-light);
}

.bg-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
}

.bg-primary h1, .bg-primary h2, .bg-primary h3 { color: var(--color-white); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--color-white);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--color-white);
  color: var(--color-white);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-ghost:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--transition), border-color var(--transition), background var(--transition);
  /* Hinweis fuers Compositing, damit der Hintergrund-Uebergang beim Scrollen
     ruckelfrei bleibt. Bewusst kein transform/translateZ hier: das bricht
     position:sticky in manchen Browser-Engines. */
  will-change: background-color, box-shadow;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  height: 58px;
  width: auto;
  transition: height var(--transition);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  position: relative;
  display: inline-block;
  padding: 10px 16px;
  color: var(--color-dark);
  font-weight: 600;
  font-size: 0.97rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 6px;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--color-primary);
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  transform: scaleX(1);
}

.main-nav a.btn {
  color: var(--color-white);
}

.main-nav a.btn::after { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-dark);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-white);
    padding: 10px 20px 26px;
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
    gap: 2px;
  }

  .main-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav a {
    padding: 14px 10px;
    border-bottom: 1px solid var(--color-border);
  }

  .main-nav a.btn {
    margin-top: 10px;
    text-align: center;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  color: var(--color-white);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(1, 40, 64, 0.92) 0%, rgba(3, 90, 156, 0.78) 55%, rgba(3, 90, 156, 0.45) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.hero-content .eyebrow { color: var(--color-white); }
.hero-content .eyebrow::before { background: var(--color-white); }

.hero-content h1 { color: var(--color-white); }

.hero-content p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.page-hero {
  min-height: 46vh;
}

/* ---------- Grids & Cards ---------- */
.grid {
  display: grid;
  gap: 28px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
}

.split.reverse .split-media { order: 2; }
.split.reverse .split-text { order: 1; }

@media (max-width: 820px) {
  .split.reverse .split-media,
  .split.reverse .split-text { order: initial; }
}

.split-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 34px 28px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: transparent;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: background var(--transition), color var(--transition);
}

.card-icon svg { width: 28px; height: 28px; }

.card:hover .card-icon {
  background: var(--color-primary);
  color: var(--color-white);
}

.card h3 { margin-bottom: 0.5em; }
.card p { color: var(--color-gray); margin-bottom: 0; }

/* Product card variant */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card .tag {
  display: inline-block;
  align-self: flex-start;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.product-card .specs {
  margin: 18px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--color-border);
  list-style: none;
  padding-left: 0;
}

.product-card .specs li {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--color-gray);
  margin-bottom: 8px;
}

.product-card .specs strong {
  color: var(--color-dark);
  font-weight: 600;
}

/* Stat / number blocks */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

.stat .num {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.stat .label {
  color: var(--color-gray);
  font-size: 0.92rem;
}

/* Auf dunklem/blauem Hintergrund (.bg-primary) muss der Kennzahlen-Text hell sein,
   sonst ist blauer Text auf blauem Grund praktisch unlesbar. */
.bg-primary .stat .num {
  color: var(--color-white);
}

.bg-primary .stat .label {
  color: rgba(255, 255, 255, 0.75);
}

/* Timeline (Startseite Geschichte) */
.timeline {
  position: relative;
  margin: 40px 0 0;
  padding-left: 34px;
  border-left: 2px solid var(--color-primary-light-2);
}

.timeline-item {
  position: relative;
  padding-bottom: 34px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -42px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

.timeline-item .year {
  font-weight: 800;
  color: var(--color-primary);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.is-visible > * {
  transition-delay: calc(var(--stagger-index, 0) * 90ms);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, html { transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field.full { grid-column: 1 / -1; }

.field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-dark);
}

.field .hint {
  font-size: 0.8rem;
  color: var(--color-gray);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

.field textarea { resize: vertical; min-height: 140px; }

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  font-size: 0.9rem;
  color: var(--color-gray);
}

.checkbox-field input {
  width: auto;
  margin-top: 4px;
  flex-shrink: 0;
}

.checkbox-field span {
  min-width: 0;
  flex: 1;
  overflow-wrap: break-word;
}

.form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  display: none;
}

.form-status.is-success {
  display: block;
  background: #e6f5ea;
  color: #1c7a3a;
  border: 1px solid #b9e6c6;
}

.form-status.is-error {
  display: block;
  background: #fdeceb;
  color: #b3261e;
  border: 1px solid #f6c6c3;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-darker);
  color: rgba(255, 255, 255, 0.82);
  padding-top: 70px;
}

.site-footer a { color: rgba(255, 255, 255, 0.82); }
.site-footer a:hover { color: var(--color-white); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 50px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

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

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-grid h4 {
  color: var(--color-white);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}

.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li { margin-bottom: 10px; }

.footer-brand img {
  height: 34px;
  width: auto;
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.92rem;
  max-width: 320px;
}

.footer-cert {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 18px 10px 10px;
  border-radius: 100px;
}

.footer-cert img {
  height: 120px;
  width: 120px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  filter: contrast(1.2) saturate(1.3);
}

.footer-cert span {
  font-size: 0.78rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.75);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer-bottom .legal-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-credit {
  padding: 0 0 22px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
}

.footer-credit a {
  color: rgba(255, 255, 255, 0.45);
}

.footer-credit a:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Cookie Consent ---------- */
.cookie-consent {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  max-width: 620px;
  margin: 0 auto;
  background: var(--color-white);
  color: var(--color-text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px 26px;
  border: 1px solid var(--color-border);
  transform: translateY(140%);
  opacity: 0;
  transition: transform var(--transition-slow), opacity var(--transition-slow);
}

.cookie-consent.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-consent h4 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.cookie-consent p {
  font-size: 0.9rem;
  color: var(--color-gray);
  margin-bottom: 18px;
}

.cookie-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-actions .btn {
  padding: 11px 20px;
  font-size: 0.9rem;
}

.cookie-actions .btn-ghost {
  border-color: var(--color-border);
  color: var(--color-gray);
}

.cookie-actions .btn-ghost:hover {
  background: var(--color-gray-light);
  color: var(--color-dark);
  border-color: var(--color-border);
}

/* ---------- Breadcrumb / page intro ---------- */
.page-intro {
  padding: 160px 0 40px;
  text-align: center;
}

.page-intro .lead { margin: 0 auto; }

/* ---------- Legal pages ---------- */
.legal-content h2 { margin-top: 1.6em; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content { color: var(--color-text); }
.legal-content .placeholder {
  background: #fff6e0;
  border: 1px dashed #e0b94a;
  padding: 1px 6px;
  border-radius: 4px;
  color: #7a5b00;
  font-size: 0.92em;
}

/* Verhindert horizontales Overflow: Flex-/Grid-Items duerfen unter ihre
   Inhalts-Mindestbreite (min-content) schrumpfen, statt den Container
   ueber die Viewport-Breite hinaus zu sprengen (v.a. bei nowrap-Buttons). */
.grid > *,
.split > *,
.stats > *,
.footer-grid > *,
.header-inner > *,
.form-grid > *,
.hero > .container {
  min-width: 0;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
