/* ===========================================================
   VendWerk – gemeinsame Responsive-Schicht
   Wird von jeder Seite im <helmet> geladen und greift dadurch
   automatisch auch für neue Seiten (z. B. Automaten-Unterseiten).
   Da die Seiten inline-styled sind, wird über Attribut-/Tag-
   Selektoren übersteuert.
   =========================================================== */

/* ---------- Deutsche Silbentrennung für Fließtext ---------- */
p, li {
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  overflow-wrap: break-word;
}

/* ---------- Hamburger / Mobile-Menü (von responsive.js erzeugt) ---------- */
.vw-burger {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: #fff; border: 1px solid #dbe3ec; border-radius: 12px;
  cursor: pointer; padding: 0;
}
.vw-burger span {
  position: relative; display: block; width: 20px; height: 2px;
  background: #2660a2; border-radius: 2px;
  transition: transform .25s, opacity .2s;
}
.vw-burger span::before, .vw-burger span::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px;
  background: #2660a2; border-radius: 2px; transition: transform .25s;
}
.vw-burger span::before { top: -6px; }
.vw-burger span::after  { top:  6px; }
.vw-burger.open span { background: transparent; }
.vw-burger.open span::before { transform: translateY(6px) rotate(45deg); }
.vw-burger.open span::after  { transform: translateY(-6px) rotate(-45deg); }

.vw-mobilemenu {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff; border-bottom: 1px solid #e8eef5;
  box-shadow: 0 22px 40px -26px rgba(14,47,79,0.45);
  flex-direction: column; padding: 10px 22px 20px; gap: 2px; z-index: 60;
}
.vw-mobilemenu a {
  text-decoration: none; color: #34373d; font-size: 16px; font-weight: 600;
  padding: 14px 6px; border-bottom: 1px solid #f0f4f9;
}
.vw-mobilemenu a:last-child { border-bottom: none; }
.vw-mobilemenu a.vw-cta {
  margin-top: 12px; background: #2660a2; color: #fff; text-align: center;
  border-radius: 999px; border: none; padding: 15px;
}

/* ---------- Tablet ---------- */
@media (max-width: 980px) {
  /* 3- und 4-spaltige Raster auf 2 Spalten */
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns: 1.5fr 1fr 1fr 1fr"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ---------- Handy ---------- */
@media (max-width: 680px) {
  /* Hamburger an, Desktop-Links aus */
  .vw-burger { display: inline-flex; }
  .vw-navlinks, .vw-navphone { display: none !important; }
  .vw-mobilemenu.open { display: flex; }

  /* Alle mehrspaltigen Raster einspaltig */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* Breite Außenränder reduzieren (64px / 56px horizontal) */
  [style*=" 64px"] { padding-left: 22px !important; padding-right: 22px !important; }
  [style*=" 56px"] { padding-left: 22px !important; padding-right: 22px !important; }

  /* Zeilenumbrüche wieder erlauben */
  [style*="white-space: nowrap"]:not(.vw-keep) { white-space: normal !important; }
  [style*="flex-wrap: nowrap"] { flex-wrap: wrap !important; }

  /* Überschriften skalieren + lange Wörter umbrechen */
  h1 { font-size: 32px !important; line-height: 1.12 !important; }
  h2 { font-size: 24px !important; line-height: 1.2 !important; }
  h1, h2, h3, p { overflow-wrap: break-word; }

  /* Große vertikale Sektions-Abstände etwas verkleinern */
  [style*="padding: 100px 64px"],
  [style*="padding: 96px 64px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
}

/* ---------- Sehr schmal ---------- */
@media (max-width: 400px) {
  [style*=" 64px"] { padding-left: 16px !important; padding-right: 16px !important; }
  [style*=" 56px"] { padding-left: 16px !important; padding-right: 16px !important; }
  h1 { font-size: 28px !important; }
}
