/*
 * Responsive-/Mobile-Ergaenzungen fuer alle Sprachseiten.
 * Wird NACH dem Inline-<style> jeder Seite geladen und ueberschreibt dort nur,
 * was auf schmalen Bildschirmen nicht funktioniert. Desktop (> 1100px) bleibt unveraendert,
 * bis auf die globalen Korrekturen im ersten Block (Umbruch statt Abschneiden).
 */

/* ---------- Global: Umbruch statt Ueberlauf ---------- */

/* Sprachleiste und Menue duerfen umbrechen statt die Seite zu verbreitern
   (DE passt auf Desktop weiterhin in eine Zeile, RU/PL bei 1024px nicht). */
.lang-switch {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.logo {
  flex-shrink: 0;
}

/* Bilder haben width/height-Attribute (reserviert Platz beim Lazy Loading);
   ohne height:auto wuerden per max-width verkleinerte Bilder verzerrt.
   :where() = Spezifitaet 0, damit feste Hoehen wie .logo img weiter gelten. */
:where(img[width][height]) {
  height: auto;
}

/* Footer-Logo hat nur eine CSS-Hoehe – Breite proportional statt aus dem width-Attribut */
.footer-logo img {
  width: auto;
}

/* Tooltips duerfen nie breiter als der Bildschirm werden */
.has-tip::after {
  max-width: min(260px, 80vw);
}

/* Sichtbarer Tastaturfokus (bisher nur Browser-Standard bzw. bei Feldern kaum sichtbar) */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid #f36f21;
  outline-offset: 2px;
}

.form-group input:focus,
.form-group textarea:focus,
.registration-field input:focus {
  box-shadow: 0 0 0 3px rgba(243, 111, 33, 0.28);
}

/* Lange Modals: oben nicht abschneiden, wenn Inhalt hoeher als der Bildschirm ist */
.contact-modal.show {
  padding: 1rem 0;
}

.contact-modal-content,
.registration-modal-content,
.newsletter-modal-content {
  margin: auto;
}

.registration-modal-content,
.newsletter-modal-content {
  max-height: 94dvh;
}

/* Menue-Schalter: nur mobil sichtbar */
.menu-toggle {
  display: none;
}

/* ---------- Bis Containerbreite: Hero-Text nicht am Rand ---------- */

@media (max-width: 1160px) {
  /* .hero-inner setzt padding: 5rem 0 4rem und loescht damit den Seitenabstand von .container */
  .hero-inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  /* Lange Uebersetzungen (RU, PL) liefen bei 1024px links und rechts aus dem Bild */
  nav ul {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
}

/* ---------- Tablet & Smartphone: Menue einklappbar ---------- */

@media (max-width: 900px) {
  .nav-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo toggle"
      "nav nav"
      "lang lang";
    align-items: center;
    gap: 0;
  }

  /* Logo, Sprachleiste und Schalter werden direkt im Grid angeordnet */
  .nav-bar-top {
    display: contents;
  }

  .logo {
    grid-area: logo;
  }

  .logo img {
    height: 44px;
  }

  .menu-toggle {
    grid-area: toggle;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0 0.85rem;
    border: 1px solid #ffe0c7;
    border-radius: 999px;
    background: #fff7f1;
    color: #222;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
  }

  .menu-toggle-icon,
  .menu-toggle-icon::before,
  .menu-toggle-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #f36f21;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .menu-toggle-icon {
    position: relative;
  }

  .menu-toggle-icon::before,
  .menu-toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .menu-toggle-icon::before { top: -6px; }
  .menu-toggle-icon::after  { top: 6px; }

  .menu-open .menu-toggle-icon { background: transparent; }
  .menu-open .menu-toggle-icon::before { transform: translateY(6px) rotate(45deg); }
  .menu-open .menu-toggle-icon::after  { transform: translateY(-6px) rotate(-45deg); }

  /* Ohne JavaScript (kein .js-menu) bleiben Menue und Sprachen sichtbar */
  .js-menu nav,
  .js-menu .lang-switch {
    display: none;
  }

  .js-menu .menu-open {
    max-height: 100dvh;
    overflow-y: auto;
    padding-bottom: 0.75rem;
  }

  .js-menu .menu-open nav,
  .js-menu .menu-open .lang-switch {
    display: grid;
  }

  nav {
    grid-area: nav;
    padding-top: 0.5rem;
  }

  nav ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 0.75rem;
    font-size: 0.95rem;
  }

  nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.35rem 0.25rem;
    border-bottom: 1px solid #f0f0f0;
    white-space: normal;
    line-height: 1.25;
  }

  .lang-switch {
    grid-area: lang;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.4rem, 1fr));
    gap: 0.4rem;
    padding-top: 0.75rem;
  }

  .lang-link {
    justify-content: center;
    min-height: 44px;
  }
}

/* ---------- Slider: Bedienung auf Touch ---------- */

@media (max-width: 700px) {
  /* Naechstes Bild/Karte anschneiden, damit erkennbar ist, dass man wischen kann */
  .image-slide {
    flex: 0 0 82%;
    max-width: 82%;
  }

  .image-slide img {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .testimonial-slide {
    flex: 0 0 88%;
    max-width: 88%;
  }

  .image-nav-btn,
  .testimonial-nav-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    font-size: 1.4rem;
  }

  /* Pfeile der Kundenstimmen unter die Karten, damit sie keinen Text verdecken */
  .testimonials-wrapper {
    padding-bottom: 52px;
  }

  .testimonial-nav-btn {
    top: auto;
    bottom: 0;
    transform: none;
  }

  .testimonial-nav-btn:hover {
    transform: none;
  }

  .testimonial-nav-btn.prev { left: calc(50% - 52px); }
  .testimonial-nav-btn.next { right: calc(50% - 52px); }
}

/* ---------- Smartphone ---------- */

@media (max-width: 600px) {
  /* Lange Einzelwoerter (z. B. bei 200 % Schriftgroesse) umbrechen statt die Seite zu verbreitern.
     "anywhere" wirkt auch auf die Mindestbreite von Flex-Elementen (FAQ, Schritte, Buttons). */
  body {
    overflow-wrap: anywhere;
  }

  /* Unsichtbare Tooltips zaehlen sonst zur Scrollbreite (Ueberlauf bei grosser Schrift) */
  .has-tip:not(:hover):not(:focus)::after {
    display: none;
  }

  /* nur seitlich – .nav-bar und .hero-inner haben eigene vertikale Abstaende */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  section {
    padding: 2.5rem 0;
  }

  .section-header {
    margin-bottom: 1.5rem;
  }

  .section-header h2 {
    font-size: clamp(1.35rem, 1rem + 2vw, 1.8rem);
    line-height: 1.3;
    hyphens: auto;
  }

  /* Buttons duerfen umbrechen (lange Uebersetzungen) und sind gut tippbar */
  .btn {
    white-space: normal;
    text-align: center;
    min-height: 44px;
    line-height: 1.3;
  }

  /* Hero: weniger Hoehe, Handlungsaufforderung frueher sichtbar */
  .hero-inner {
    padding: 2rem 1rem 2.25rem;
    gap: 1.5rem;
  }

  .hero h1 {
    font-size: clamp(1.55rem, 1.1rem + 2.6vw, 2.1rem);
    line-height: 1.25;
    margin-bottom: 0.75rem;
    hyphens: auto;
  }

  .hero h2 {
    font-size: 1.02rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  .hero-list {
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
  }

  .hero-actions {
    align-items: stretch;
  }

  .hero-card {
    max-width: none;
    padding: 1.15rem;
  }

  .hero-mini {
    border-radius: 0.9rem;
  }

  /* Angebot & Vorteile: kompaktere Karten, Icon neben der Ueberschrift */
  .offer-grid {
    gap: 1rem;
  }

  .offer-card {
    padding: 1.15rem 1.2rem;
  }

  .feature-grid {
    gap: 0.75rem;
  }

  .feature-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 0.85rem;
    row-gap: 0.2rem;
    align-items: center;
    padding: 1rem 1.1rem;
  }

  .feature-icon {
    grid-row: span 2;
    align-self: start;
    margin: 0;
    object-fit: contain;
  }

  .feature-card h3 {
    margin: 0;
  }

  /* Reservierung: die beiden Buttons haben inline width:280px */
  .reservation .btn {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .reservation .btn + span {
    flex: 1 1 100%;
    text-align: center;
  }

  .reservation-box,
  .pricing-box,
  .contact-box {
    padding: 1.15rem;
  }

  /* FAQ: groessere Tippflaeche */
  summary {
    min-height: 44px;
    line-height: 1.35;
  }

  details {
    padding: 0.6rem 0.9rem;
  }

  /* Preistabelle: jede Zeile als Block – Leistung + Preis oben, Details darunter */
  .pricing-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .pricing-table,
  .pricing-table tbody {
    display: block;
  }

  .pricing-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid #f0f0f0;
  }

  .pricing-table tbody tr:last-child {
    border-bottom: none;
  }

  .pricing-table td {
    display: block;
    padding: 0;
  }

  .pricing-table td:nth-child(1) {
    font-weight: 600;
  }

  .pricing-table td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    color: #666;
    font-size: 0.85rem;
  }

  .pricing-table td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    max-width: 11rem;
    white-space: nowrap;
  }

  .pricing-table td:nth-child(3) span {
    white-space: normal;
  }

  /* Galerie: zwei Spalten statt vier Bilder untereinander */
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .gallery-grid img {
    aspect-ratio: 4 / 3;
  }

  .map-wrapper {
    height: 280px;
  }

  .contact-box strong {
    min-width: 0;
    margin-right: 0.25rem;
  }

  .contact-box a {
    overflow-wrap: anywhere;
  }

  /* Footer */
  footer {
    padding: 1.75rem 0 5.5rem; /* Platz fuer den schwebenden Kontakt-Button */
  }

  .footer-logo img {
    height: 44px;
  }

  .footer-main {
    flex-direction: column;
    gap: 1.25rem;
  }

  .footer-links {
    gap: 0;
  }

  .footer-links a {
    display: flex;
    align-items: center;
    min-height: 40px;
  }

  .footer-newsletter p {
    max-width: none;
  }

  /* Formulare: 16px verhindert das automatische Hineinzoomen in iOS Safari */
  .form-group input,
  .form-group textarea,
  .registration-field input {
    font-size: 16px;
  }

  .contact-modal-content,
  .registration-modal-content,
  .newsletter-modal-content {
    width: calc(100% - 1.5rem);
    padding: 1.25rem 1.1rem;
  }

  .contact-modal h2,
  .registration-modal h2,
  .newsletter-modal h2 {
    font-size: 1.35rem;
    padding-right: 2.5rem;
  }

  .contact-modal-close {
    top: 0.6rem;
    right: 0.6rem;
    width: 44px;
    height: 44px;
  }

  .registration-modal-close,
  .newsletter-modal-close {
    top: 0.6rem;
    right: 0.6rem;
    width: 44px;
    height: 44px;
  }

  .fee-note {
    display: block;
    margin-left: 0;
  }

  /* Sendung anmelden: Auswahl Paket/Spedition als groessere Tippflaeche */
  .form-group label:has(input[type="radio"]) {
    padding: 0.45rem 0;
    cursor: pointer;
  }

  .form-group input[type="radio"] {
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.4rem;
    vertical-align: -0.2rem;
    accent-color: #f36f21;
  }
}

/* ---------- Schnellkontakt-Leiste (WhatsApp, Anrufen, Route, Teilen) ---------- */

/* Anmeldeformular per WhatsApp: heller Button, damit er neben den orangen nicht konkurriert */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: #fff;
  color: #075e54;
  border: 2px solid #25d366;
}

.btn-whatsapp:hover {
  background: #effcf3;
  color: #075e54;
}

.btn-whatsapp svg {
  width: 1.2em;
  height: 1.2em;
  flex: none;
}

.quick-bar,
.share-panel {
  display: none;
}

@media (max-width: 900px) {
  .quick-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .quick-bar a,
  .quick-bar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 56px;
    padding: 0.35rem 0.2rem;
    border: 0;
    background: none;
    color: #333;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  }

  .quick-bar span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .quick-bar svg {
    width: 24px;
    height: 24px;
    color: #f36f21;
  }

  .quick-bar .quick-whatsapp svg {
    color: #25d366;
  }

  .quick-bar a:active,
  .quick-bar button:active {
    background: #fff4ec;
  }

  /* Platz fuer die Leiste: Seitenende und runder Kontakt-Button nicht verdecken */
  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }

  .contact-trigger-btn {
    bottom: calc(56px + 1rem + env(safe-area-inset-bottom));
  }

  /* Ersatz-Auswahl, falls der Browser kein Teilen-Menue (navigator.share) hat */
  .share-panel:not([hidden]) {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(56px + 0.75rem + env(safe-area-inset-bottom));
    z-index: 10000;
    /* ueber dem runden Kontakt-Button (9999) */
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }

  .share-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    padding: 0 0.25rem 0.25rem;
  }

  .share-panel-close {
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
  }

  /* Dienste als Kacheln mit Logo, darunter "Weitere Apps" und "Link kopieren" */
  .share-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
    margin-bottom: 0.25rem;
  }

  .share-grid a,
  .share-grid button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.1rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #333;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    /* Dienstnamen nie mitten im Wort trennen (Smartphone-Block erlaubt das global) */
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
  }

  .share-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #fff;
  }

  .share-logo svg {
    width: 26px;
    height: 26px;
  }

  .share-logo-whatsapp { background: #25d366; }
  .share-logo-facebook { background: #0866ff; }
  .share-logo-x { background: #000; }
  .share-logo-instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  }

  .share-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 8px;
    background: #f7f7f7;
    color: #333;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }

  .share-row[hidden] {
    display: none;
  }

  .share-row svg {
    width: 20px;
    height: 20px;
    color: #f36f21;
  }

  .share-status:empty {
    display: none;
  }

  .share-status {
    margin: 0.25rem 0 0;
    padding: 0 0.25rem;
    font-size: 0.85rem;
    color: #075e54;
  }
}
