/* =========================================================
   IT-Visions – Responsive Mega-Menü (ohne Framework)
   Breakpoint: >= 1280px Mega-Menü, darunter Drawer + Akkordeon
   ========================================================= */

:root {
  /* CI-Farben */
  --itv-primary: #12B4FF;
  --itv-blue-1: #009DDF;   /* dunkel  */
  --itv-blue-2: #00B4E7;
  --itv-blue-3: #82CEEF;
  --itv-blue-4: #C8E8F7;   /* hell    */
  --itv-blue-5: #E9F6FC;   /* Tint für Flächen */

  /* Neutrale Töne */
  --itv-ink: #0B2540;      /* Text auf Blau (Kontrast >= 4,5:1) */
  --itv-text: #0E2238;
  --itv-muted: #4F6680;
  --itv-line: #C8E8F7;
  --itv-bg: #FFFFFF;

  --itv-radius: 10px;
  --itv-bar-h: 64px;
  --itv-font: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --itv-ease: 180ms ease;
}

.itv-header *, .itv-header *::before, .itv-header *::after { box-sizing: border-box; }

.itv-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  font-family: var(--itv-font);
  color: var(--itv-text);
  background: var(--itv-bg);
}
.itv-header a { color: inherit; }
.itv-header a,
.itv-header a:hover,
.itv-header a:focus,
.itv-header a:active { text-decoration: none; }
:where(.itv-header) ul { list-style: none; margin: 0; padding: 0; }
:where(.itv-header) button { font: inherit; color: inherit; cursor: pointer; }
.itv-header :focus-visible { outline: 3px solid var(--itv-blue-1); outline-offset: 2px; border-radius: 6px; }

.itv-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;
}

/* ---------- Topbar ---------- */
.itv-topbar {
  background: var(--itv-primary);
  color: var(--itv-ink);
  font-size: 13px;
}
.itv-topbar__inner {
  max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 48px);
  min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.itv-topbar__claim { display: flex; align-items: center; gap: 12px; }
.itv-badge {
  background: #fff; color: var(--itv-ink); font-weight: 700; font-size: 12px;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.itv-topbar__links { display: flex; align-items: center; gap: 20px; }
.itv-topbar__phone { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Hauptleiste ---------- */
.itv-bar {
  position: relative;
  max-width: 1440px; margin: 0 auto;
  height: var(--itv-bar-h);
  padding: 0 clamp(16px, 3vw, 48px);
  display: flex; align-items: center; gap: 24px;
}
.itv-bar-wrap { border-bottom: 1px solid var(--itv-line); background: var(--itv-bg); position: relative; }

.itv-logo { display: flex; flex-direction: column; line-height: 1.1; flex-shrink: 0; }
.itv-logo img { display: block; height: 44px; width: auto; }
.itv-logo__name { font-size: 24px; font-weight: 800; font-style: italic; color: var(--itv-ink); letter-spacing: -.5px; }
.itv-logo__sub { font-size: 12px; font-weight: 700; color: #3D5470; }

.itv-burger {
  display: none;
  margin: 0 0 0 auto; padding: 0; align-self: center; line-height: 0; vertical-align: middle;
  width: 48px; height: 48px; border: 0; border-radius: var(--itv-radius);
  background: var(--itv-blue-4); color: var(--itv-ink);
  align-items: center; justify-content: center;
}
.itv-burger .itv-icon-close { display: none; }
.itv-burger svg { display: block; }
.itv-burger[aria-expanded="true"] .itv-icon-open { display: none; }
.itv-burger[aria-expanded="true"] .itv-icon-close { display: block; }

/* ---------- Navigation (Desktop-Basis) ---------- */
.itv-nav { flex: 1; display: flex; align-items: center; gap: 16px; min-width: 0; }
.itv-menu { display: flex; align-items: center; gap: 2px; }

.itv-trigger {
  display: flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 14px; border: 0; border-radius: 8px;
  background: transparent; font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--itv-ease), box-shadow var(--itv-ease);
}
.itv-trigger:hover { background: var(--itv-blue-4); }
.itv-trigger[aria-expanded="true"] {
  background: var(--itv-blue-4); color: var(--itv-ink);
  box-shadow: inset 0 -3px 0 var(--itv-primary);
}
.itv-chevron { transition: transform var(--itv-ease); flex-shrink: 0; }
.itv-trigger[aria-expanded="true"] .itv-chevron { transform: rotate(180deg); }

/* Suche */
.itv-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  height: 44px; width: min(260px, 22vw); padding: 0 10px 0 14px;
  border: 1px solid var(--itv-blue-3); border-radius: var(--itv-radius); background: #fff; color: var(--itv-muted);
  transition: border-color var(--itv-ease), box-shadow var(--itv-ease);
}
.itv-search:focus-within { border-color: var(--itv-blue-1); box-shadow: 0 0 0 3px var(--itv-blue-4); }
.itv-search__icon { display: flex; color: inherit; }
.itv-search input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 14px; color: var(--itv-text);
}
.itv-search input:focus-visible { outline: none; }
.itv-search kbd {
  font: inherit; font-size: 11px; font-weight: 700; padding: 2px 6px;
  border: 1px solid var(--itv-blue-4); border-radius: 6px; background: var(--itv-blue-5); white-space: nowrap;
}

/* CTA */
.itv-cta {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px; border-radius: var(--itv-radius);
  background: var(--itv-primary); color: var(--itv-ink);
  font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: background-color var(--itv-ease), transform var(--itv-ease);
}
.itv-cta:hover { background: var(--itv-blue-4); transform: translateY(-1px); }
.itv-drawer-foot { display: none; }

/* ---------- Mega-Panel ---------- */
.itv-panel { display: none; }
.itv-trigger[aria-expanded="true"] + .itv-panel { display: block; }

.itv-panel__inner { display: flex; gap: 40px; }
.itv-cols { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }

.itv-col h3 {
  margin: 0 0 8px; padding: 0 12px 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--itv-muted);
  border-bottom: 3px solid var(--col, var(--itv-primary));
}
.itv-col--0 { --col: var(--itv-blue-1); }
.itv-col--1 { --col: var(--itv-blue-2); }
.itv-col--2 { --col: var(--itv-blue-3); }

.itv-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  transition: background-color var(--itv-ease), transform var(--itv-ease);
}
.itv-link__text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.itv-link__title { font-size: 15px; font-weight: 600; }
.itv-link__desc { font-size: 13px; color: var(--itv-muted); transition: color var(--itv-ease); }
.itv-link__arrow { opacity: 0; transform: translateX(-6px); transition: opacity var(--itv-ease), transform var(--itv-ease); flex-shrink: 0; }

.itv-link:hover, .itv-link:focus-visible {
  background: var(--itv-blue-4); color: var(--itv-ink); transform: translateX(4px);
}
.itv-link:hover .itv-link__desc, .itv-link:focus-visible .itv-link__desc { color: var(--itv-ink); }
.itv-link:hover .itv-link__arrow, .itv-link:focus-visible .itv-link__arrow { opacity: 1; transform: none; }

.itv-feature {
  width: 300px; flex-shrink: 0;
  align-self: flex-start; height: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 24px; border-radius: 14px; background: var(--itv-blue-4); color: var(--itv-ink);
}
.itv-feature__tag {
  align-self: flex-start; background: yellow; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 8px;
}
.itv-feature__title { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.2; }
.itv-feature__text { margin: 0; font-size: 14px; color: #23384F; }
.itv-feature .itv-cta { align-self: flex-start; font-size: 14px; color: #fff; transition: color var(--itv-ease), transform var(--itv-ease); }
.itv-feature .itv-cta:hover,
.itv-feature .itv-cta:focus-visible { background: var(--itv-primary); color: #000; text-decoration: none; }

.itv-panel__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 3vw, 48px); background: var(--itv-blue-5); border-top: 1px solid var(--itv-line); font-size: 14px;
}
.itv-panel__foot span { color: var(--itv-muted); }
.itv-panel__foot a { font-weight: 700; }

.itv-backdrop {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(11, 37, 64, .45);
  opacity: 0; visibility: hidden; transition: opacity var(--itv-ease), visibility var(--itv-ease);
}
.itv-backdrop.is-visible { opacity: 1; visibility: visible; }

/* =========================================================
   DESKTOP  (>= 1280px)
   ========================================================= */
@media (min-width: 1280px) {
  .itv-panel {
    position: absolute; left: 0; right: 0; top: 100%;
    max-height: calc(100vh - var(--itv-bar-h));
    overflow-y: auto; overscroll-behavior: contain;
    background: #fff;
    border-top: 3px solid var(--itv-primary);
    border-bottom: 1px solid var(--itv-line);
    box-shadow: 0 24px 48px rgba(11, 37, 64, .18);
    animation: itv-drop 180ms ease;
  }
  .itv-panel__inner { padding: 32px clamp(16px, 3vw, 48px) 36px; max-width: 1440px; margin: 0 auto; }

  /* Ohne JavaScript: Hover/Fokus öffnet das Panel trotzdem */
  html:not(.itv-js) .itv-item:hover > .itv-panel,
  html:not(.itv-js) .itv-item:focus-within > .itv-panel { display: block; }
}
/* Kompakte Suche: Lupe, klappt beim Fokus nach links auf */
@media (min-width: 1280px) and (max-width: 1679.98px) {
  .itv-search { position: relative; z-index: 2; width: 44px; padding: 0 12px; gap: 0; transition: width var(--itv-ease), margin var(--itv-ease), box-shadow var(--itv-ease); }
  .itv-search input { width: 0; flex: 0 0 0; }
  .itv-search kbd { display: none; }
  .itv-search:focus-within { width: 300px; margin-left: -256px; gap: 10px; }
  .itv-search:focus-within input { flex: 1 1 auto; }
  .itv-search__icon { cursor: pointer; }
}
/* Schmaleres Desktop */
@media (min-width: 1280px) and (max-width: 1439.98px) {
  .itv-trigger { padding: 0 10px; font-size: 14px; }
  .itv-logo__name { font-size: 20px; }
  .itv-cta { padding: 0 14px; }
  .itv-feature { width: 260px; }
}

@keyframes itv-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* =========================================================
   TABLET / MOBIL  (< 1280px)
   ========================================================= */
@media (max-width: 1279.98px) {
  :root { --itv-bar-h: 56px; }

  .itv-topbar { display: none; }
  .itv-logo__name { font-size: 19px; }
  .itv-logo__sub { font-size: 11px; }
  .itv-burger { display: inline-flex; }
  .itv-bar { gap: 8px; }

  .itv-nav {
    position: fixed; left: 0; right: 0; bottom: 0;
    top: var(--itv-bar-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff;
    overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(100%); visibility: hidden;
    transition: transform 240ms ease, visibility 240ms;
  }
  .itv-nav.is-open { transform: none; visibility: visible; }
  .itv-nav > * { flex-shrink: 0; }

  .itv-search { order: -1; margin: 16px 16px 8px; width: auto; height: 48px; }
  .itv-search input { font-size: 16px; } /* verhindert iOS-Zoom */
  .itv-search kbd { display: none; }

  .itv-menu { flex-direction: column; align-items: stretch; gap: 0; padding: 0 16px; }
  .itv-item { border-bottom: 1px solid var(--itv-line); }
  .itv-trigger {
    width: 100%; height: auto; min-height: 56px; padding: 0 4px;
    justify-content: space-between; font-size: 17px; font-weight: 700; border-radius: 0;
  }
  .itv-trigger[aria-expanded="true"] { box-shadow: none; }
  .itv-chevron { color: var(--itv-blue-1); }

  .itv-panel { padding: 0 0 12px; }
  .itv-panel__inner { flex-direction: column; gap: 12px; }
  .itv-cols { grid-template-columns: 1fr; gap: 12px; }
  .itv-col { background: var(--itv-blue-5); border-radius: var(--itv-radius); padding: 6px; border-top: 3px solid var(--col); }
  .itv-col h3 { border-bottom: 0; padding: 8px 12px 4px; margin: 0; }
  .itv-link { min-height: 44px; }
  .itv-link__desc { display: none; }
  .itv-feature { width: auto; align-self: stretch; padding: 16px; }
  .itv-panel__foot { display: none; }

  .itv-nav > .itv-cta { display: none; }
  .itv-drawer-foot {
    display: flex; gap: 10px; margin-top: auto;
    position: sticky; bottom: 0;
    padding: 12px 16px 20px; background: #fff; border-top: 1px solid var(--itv-line);
  }
  .itv-drawer-foot .itv-cta { flex: 1; height: 52px; font-size: 16px; }
  .itv-drawer-close {
    width: 52px; height: 52px; flex-shrink: 0; margin-left: auto; padding: 0; background: #fff;
    border: 1px solid var(--itv-blue-3); border-radius: 12px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; color: var(--itv-ink);
  }
  .itv-call {
    width: 52px; height: 52px; flex-shrink: 0; border: 1px solid var(--itv-blue-3); border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center; color: var(--itv-ink);
  }

  html.itv-lock, html.itv-lock body { overflow: hidden; }

  /* Tablet
  @media (min-width: 640px) {
    .itv-nav { left: auto; width: 420px; box-shadow: -16px 0 40px rgba(11, 37, 64, .18); }
  }

  /* Ohne JavaScript: Menü einfach unter dem Header anzeigen */
  html:not(.itv-js) .itv-nav { position: static; transform: none; visibility: visible; }
  html:not(.itv-js) .itv-panel { display: block; }
  html:not(.itv-js) .itv-burger { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .itv-header *, .itv-backdrop { transition: none !important; animation: none !important; }
}
