/* ============================================================
   sleepArt — Mobile Final Polish (max-width: 640px)
   Overlay für konsistente Mobile-Erfahrung
   Wird NACH allen anderen CSS geladen
   ============================================================ */

/* ---- Base: Horizontal-Scroll-Schutz für alle Seiten ---- */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ---- Alle Media-Queries für Mobile (<= 640px) ---- */
@media (max-width: 640px) {

  /* Base font-size für konsistente Lesbarkeit */
  html {
    font-size: 15px;
  }
  body {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
  }

  /* Wrap-Container: konsistentes Padding */
  .wrap {
    padding-inline: 20px !important;
    max-width: 100%;
  }

  /* Section-Head zentriert für Mobile — konsistent auf allen Seiten */
  .section-head,
  .section-head-eyebrow,
  .section-head-title {
    text-align: center;
  }
  .eyebrow {
    display: inline-block;
    margin: 0 auto 12px;
  }

  /* Hero-Titel zentriert + kompakter */
  .hero-headline,
  .hero h1 {
    text-align: center !important;
    padding-inline: 4px;
  }
  .hero .lead,
  .hero-lead {
    text-align: center !important;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  /* Hero-CTA-Buttons zentriert und stapeln */
  .hero .btn,
  .hero > div .btn {
    width: 100%;
    max-width: 340px;
    justify-content: center;
  }
  /* Hero-Meta-Zeile zentriert */
  .hero-meta {
    justify-content: center;
    text-align: center;
  }

  /* Touch-Targets: mindestens 44px hoch */
  .btn,
  button.btn,
  a.btn,
  .btn-primary,
  .btn-ghost {
    min-height: 44px;
    padding-inline: 20px;
    font-size: 15px;
  }
  /* Nav-Links: min. 44px klickbar */
  .nav-links a,
  .nav-drawer a,
  nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Forms: Input min. 44px + kein Zoom */
  input, select, textarea, button {
    font-size: 16px; /* Verhindert iOS-Zoom */
    min-height: 44px;
  }
  textarea {
    min-height: 100px;
  }

  /* Karten-Grid: 1-spaltig */
  .apt-rail,
  .card-grid,
  .grid,
  .three-col,
  .two-col {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  /* Featured-Card nicht mehr überspannen */
  .apt-card.featured {
    grid-column: unset !important;
    aspect-ratio: 4/5 !important;
  }

  /* Card-Padding kompakter */
  .card,
  .apt-card,
  .info-card,
  .review-portal,
  .testimonial {
    padding: 18px !important;
  }

  /* Footer: Grid stapeln, zentriert */
  footer,
  .footer,
  .site-footer {
    text-align: center;
  }
  .footer__inner,
  .footer-grid,
  .site-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px;
    text-align: center;
  }
  .footer__bottom,
  .site-footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  /* Marquee: langsamer damit lesbar */
  .marquee {
    animation-duration: 60s !important;
  }

  /* Testimonial: zentrierter Text */
  .testimonial,
  .testimonial-quote {
    text-align: center;
  }
  .testimonial-meta {
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  /* Booking-Widget: Felder stapeln */
  #availability .home-search-card,
  .search-card {
    grid-template-columns: 1fr !important;
    padding: 20px !important;
  }

  /* FAQ: mehr Padding für Touch */
  .faq-q,
  .faq-item button {
    padding: 16px 12px !important;
    min-height: 56px;
  }

  /* Section-Padding konsistent */
  section,
  .section {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }

  /* H1/H2/H3-Skalierung auf Mobile */
  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.1;
    text-align: center;
  }
  h2 {
    font-size: clamp(1.65rem, 6.5vw, 2.4rem);
    line-height: 1.15;
  }
  h3 {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
    line-height: 1.25;
  }

  /* Body-Copy: mindestens 15px + gute Zeilenhöhe */
  p, li, .lead {
    line-height: 1.6;
  }

  /* Word-Break für Wörter die überlaufen könnten */
  h1, h2, h3, p, li {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
  }

  /* Nowrap-Elemente die auf Mobile brechen dürfen */
  .no-mobile-nowrap {
    white-space: normal !important;
  }

  /* Tabellen scrollbar machen */
  table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }

  /* Images/Video volle Breite */
  img, video, iframe {
    max-width: 100%;
    height: auto;
  }

  /* Fixed-Position-Elemente kompakter */
  .back-to-top,
  .btt {
    width: 44px !important;
    height: 44px !important;
    bottom: 16px !important;
    right: 16px !important;
  }

  /* Sticky-Bars: Padding damit Content nicht drunter verschwindet */
  body {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Iframes/Maps: max-width */
  .map-wrap iframe {
    height: 240px !important;
  }
}

/* ---- Sehr schmale Screens (<= 380px) — extra Kompression ---- */
@media (max-width: 380px) {
  .wrap {
    padding-inline: 16px !important;
  }
  .card,
  .apt-card,
  .info-card {
    padding: 14px !important;
  }
  h1 {
    font-size: 1.85rem;
  }
  h2 {
    font-size: 1.5rem;
  }
}
