/* ============================================================
   buchbeiuns.de — Handy-Ansicht
   Gilt nur auf schmalen Bildschirmen (<= 820 px) und nur, wenn der Gast
   "Handy-Ansicht" gewählt hat (html.m-mode). Ohne Wahl bleibt alles wie bisher.
   Layout-Regel: Schnellleiste unten LINKS, HostBuddy-Chat unten RECHTS
   (--m-chat-reserve = Platz für den Chat-Button, bei Bedarf anpassen).
   ============================================================ */

:root { --m-chat-reserve: 176px; --m-radius: 14px; }

/* Per JS eingefügte Elemente: standardmäßig aus */
.m-strip, .m-burger, .m-sheet, .m-dock, .m-footer-switch, .m-lb { display: none; }
.m-switch-btn .m-off, .m-strip-btn .m-off { display: none; }

@media (max-width: 820px) {

  /* Kopfzeile: seitlicher Abstand (war durch .header-inner{padding:16px 0} verloren) */
  .header-inner { padding-left: 18px; padding-right: 18px; }

  /* ---------- Umschalt-Elemente ---------- */
  .m-strip {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--ink); color: rgba(255,255,255,.9);
    padding: 8px 16px; font-size: .84rem; line-height: 1.3;
  }
  .m-strip-btn, .m-switch-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 .9rem var(--font-body); cursor: pointer; border: 0;
    min-height: 40px; padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  }
  .m-strip-btn { background: var(--gold); color: #fff; flex: none; }
  .m-strip-btn span, .m-switch-btn span { display: inline-flex; align-items: center; gap: 8px; }
  .m-footer-switch { display: block; background: var(--ink); padding: 0 0 20px; text-align: center; }
  .m-switch-btn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
  .m-switch-btn:active { background: rgba(255,255,255,.12); }

  /* in der Handy-Ansicht: Hinweisleiste weg, Umschalter zeigt "Normale Ansicht" */
  html.m-mode .m-strip { display: none; }
  html.m-mode .m-switch-btn .m-on, html.m-mode .m-strip-btn .m-on { display: none; }
  html.m-mode .m-switch-btn .m-off { display: inline-flex; }

  /* ============================================================
     HANDY-ANSICHT
     ============================================================ */
  html.m-lock, html.m-lock body { overflow: hidden; }
  html.m-mode { scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
  html.m-mode body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    -webkit-tap-highlight-color: rgba(192,138,62,.18);
  }
  html.m-mode body.m-nodock, html.m-mode:not(.m-nav) body { padding-bottom: 0; }

  html.m-mode .container { padding: 0 18px; }
  html.m-mode section { padding: 44px 0; }
  html.m-mode h1 { font-size: clamp(1.95rem, 8.4vw, 2.5rem); line-height: 1.12; }
  html.m-mode h2 { font-size: clamp(1.5rem, 6.4vw, 1.9rem); }
  html.m-mode p { font-size: 1.02rem; line-height: 1.65; }
  html.m-mode .section-head { margin-bottom: 26px; }

  /* ---------- Buttons: große Tippflächen ---------- */
  html.m-mode .btn {
    display: inline-flex; align-items: center; justify-content: center; text-align: center;
    min-height: 52px; padding: 14px 22px; font-size: 1rem; border-radius: var(--m-radius);
  }
  html.m-mode .btn:active { transform: scale(.98); }
  html.m-mode .btn:hover { transform: none; }

  /* ---------- Kopfzeile ---------- */
  html.m-mode .site-header { background: rgba(244,240,230,.97); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  html.m-mode .header-inner { padding-top: 8px; padding-bottom: 8px; gap: 8px; min-height: 62px; }
  html.m-mode .logo { font-size: 1.35rem; margin-right: auto; }
  html.m-mode .nav-toggle { display: none !important; }
  html.m-nav.m-mode nav.main-nav,
  html.m-nav.m-mode .site-header.nav-open nav.main-nav { display: none !important; }
  html.m-mode .m-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: var(--m-radius);
    border: 1px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer; padding: 0;
  }
  html.m-mode .m-burger:active { background: var(--parchment-deep); }
  html.m-mode .lang-switch { margin-right: 0; }
  html.m-mode .lang-switch-btn { min-height: 48px; padding: 6px 12px; border-radius: var(--m-radius); background: var(--white); }
  html.m-mode .lang-switch-menu { min-width: 210px; border-radius: var(--m-radius); }
  html.m-mode .lang-switch-menu button { padding: 13px 12px; font-size: 1rem; }

  /* ---------- Menü-Sheet ---------- */
  html.m-mode .m-sheet {
    display: flex; flex-direction: column;
    position: fixed; inset: 0; z-index: 950; background: var(--parchment);
    visibility: hidden; opacity: 0; transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  html.m-mode .m-sheet.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .m-sheet-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px; min-height: 62px; border-bottom: 1px solid var(--line); flex: none; }
  .m-sheet-close {
    width: 48px; height: 48px; border-radius: var(--m-radius); border: 1px solid var(--line);
    background: var(--white); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  }
  .m-sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 18px 18px calc(110px + env(safe-area-inset-bottom, 0px)); }

  .m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
  .m-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 16px; border-radius: var(--m-radius); background: var(--white);
    border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 1rem; min-height: 84px;
  }
  .m-tile svg { color: var(--gold-deep); }
  .m-tile:active { background: var(--parchment-deep); }
  .m-tile-call { background: var(--ink); color: #fff; border-color: var(--ink); }
  .m-tile-call svg { color: var(--gold); }

  .m-acc { background: var(--white); border: 1px solid var(--line); border-radius: var(--m-radius); margin-bottom: 12px; overflow: hidden; }
  .m-acc summary {
    list-style: none; display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px; min-height: 56px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; cursor: pointer; color: var(--ink);
  }
  .m-acc summary::-webkit-details-marker { display: none; }
  .m-acc summary svg { transition: transform .2s ease; color: var(--stone); }
  .m-acc[open] summary svg { transform: rotate(90deg); }
  .m-acc ul { list-style: none; margin: 0; padding: 0 10px 10px; }
  .m-acc li { display: flex; align-items: stretch; gap: 8px; border-top: 1px solid var(--line); padding: 8px 0; }
  .m-acc li:first-child { border-top: 0; }
  .m-row { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 6px 8px; min-height: 52px; border-radius: 10px; }
  .m-row:active { background: var(--parchment); }
  .m-row-name { font-weight: 600; font-size: .98rem; color: var(--ink); line-height: 1.25; }
  .m-row-hint { font-size: .8rem; color: var(--stone); margin-top: 2px; }
  .m-row-book {
    flex: none; align-self: center; display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--gold); color: #fff; font-weight: 600; font-size: .9rem;
  }
  .m-row-book:active { background: var(--gold-deep); }

  .m-sheet-foot { margin: 22px 0 6px; }
  .m-foot-link { display: flex; align-items: center; gap: 12px; min-height: 52px; font-weight: 600; color: var(--ink); word-break: break-all; }
  .m-foot-link svg { color: var(--gold-deep); flex: none; }
  .m-hours { margin: 2px 0 0; font-size: .88rem; color: var(--stone); }
  .m-sheet-switch { margin: 18px 0 8px; }
  .m-sheet-switch .m-switch-btn { color: var(--ink); border-color: var(--ink); }
  .m-sheet-switch .m-switch-btn:active { background: var(--parchment-deep); }
  .m-switch-wide { width: 100%; min-height: 52px; border-radius: var(--m-radius); }
  .m-legal { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 14px; }
  .m-legal a { font-size: .86rem; color: var(--stone); padding: 10px 0; text-decoration: underline; text-underline-offset: 3px; }

  /* ---------- Schnellleiste unten (links, kompakt, verschiebbar) — HostBuddy bleibt rechts ---------- */
  html.m-mode .booking-float-tab { display: none !important; }
  html.m-mode .m-dock {
    display: flex; align-items: center; position: fixed; z-index: 910; touch-action: none;
    left: 12px; right: auto; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    gap: 4px; padding: 5px 5px 5px 2px; border-radius: 999px;
    background: rgba(36,53,43,.97); box-shadow: 0 12px 28px -10px rgba(0,0,0,.5);
    transition: opacity .18s ease;
  }
  html.m-mode .m-dock.is-drag { transition: none; box-shadow: 0 18px 36px -10px rgba(0,0,0,.6); }
  html.m-mode.m-kb .m-dock, html.m-mode.m-lock .m-dock { opacity: 0; pointer-events: none; }
  .m-dock-grip {
    flex: none; width: 18px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.55); cursor: grab; touch-action: none; border: 0; background: none; padding: 0;
  }
  .m-dock-grip svg { width: 10px; height: 18px; }
  .m-dock.is-drag .m-dock-grip { cursor: grabbing; }
  .m-dock-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 999px;
    background: rgba(255,255,255,.12); color: #fff; font: 600 .9rem var(--font-body); white-space: nowrap;
  }
  .m-dock-btn svg { width: 20px; height: 20px; }
  .m-dock-btn:active { transform: scale(.96); }
  .m-dock-primary { background: var(--gold); padding: 0 14px 0 12px; }
  .m-dock-primary:active { background: var(--gold-deep); }
  .m-dock.is-compact .m-dock-primary span { display: none; }
  .m-dock.is-compact .m-dock-primary { padding: 0; width: 44px; }

  /* ---------- Startseite: Hero + Suchkarte ---------- */
  html.m-mode .ridge-divider { display: none; }
  html.m-mode .hero { padding: 30px 0 38px; }
  html.m-mode .hero-inner { display: flex; flex-direction: column; max-width: none; }
  html.m-mode .hero p.lead { font-size: 1.02rem; line-height: 1.55; margin-bottom: 4px; }
  html.m-mode .booking-bar { order: 1; margin-top: 22px; padding: 18px; gap: 12px; max-width: none; border-radius: 18px; }
  html.m-mode .avail-results { order: 2; max-width: none; margin-top: 14px; border-radius: 18px; }
  html.m-mode .hero-actions { order: 3; flex-direction: column; margin-top: 18px; gap: 10px; }
  html.m-mode .hero-actions .btn { width: 100%; }
  html.m-mode .booking-field { flex: 1 1 100%; min-width: 0; }
  html.m-mode .booking-bar .booking-field:nth-child(-n+4) { flex: 1 1 calc(50% - 6px); }
  html.m-mode .booking-dog { flex: 1 1 100%; padding-bottom: 0; }
  html.m-mode .booking-field label { font-size: .72rem; margin-bottom: 6px; }
  html.m-mode .booking-field input, html.m-mode .booking-field select {
    min-height: 54px; font-size: 16px; /* 16px verhindert Zoom auf iPhones */
    padding: 12px 14px; border-radius: 12px;
  }
  html.m-mode .booking-field select { appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%236B7169' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
  html.m-mode #h-search { flex: 1 1 100%; min-height: 56px; font-size: 1.05rem; align-self: auto !important; }

  /* Ergebnisse der Verfügbarkeitssuche */
  html.m-mode .avail-item { grid-template-columns: 72px 1fr; padding: 14px; border-radius: 14px; }
  html.m-mode .avail-thumb img { width: 72px; height: 56px; border-radius: 8px; }
  html.m-mode .avail-price { grid-column: 1 / -1; text-align: left; font-size: 1.15rem; }
  html.m-mode .avail-price small { display: inline; margin-left: 6px; }
  html.m-mode .avail-actions { flex-direction: column; gap: 8px; }
  html.m-mode .avail-btn { width: 100%; min-height: 52px; font-size: 1rem; }
  html.m-mode .avail-foot { font-size: .92rem; }

  /* ---------- Kalender als Bottom-Sheet ---------- */
  html.m-mode .flatpickr-calendar.open {
    position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important;
    bottom: 0 !important; width: 100% !important; max-width: none !important;
    border-radius: 22px 22px 0 0; border: 0; padding: 10px 8px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -18px 50px -10px rgba(0,0,0,.45); transform: none !important;
  }
  html.m-mode .flatpickr-calendar.open::before, html.m-mode .flatpickr-calendar.open::after { display: none; }
  html.m-mode .flatpickr-calendar .flatpickr-innerContainer,
  html.m-mode .flatpickr-calendar .flatpickr-rContainer,
  html.m-mode .flatpickr-calendar .flatpickr-days,
  html.m-mode .flatpickr-calendar .dayContainer { width: 100% !important; min-width: 100% !important; max-width: 100% !important; }
  html.m-mode .flatpickr-calendar .flatpickr-weekdays { width: 100%; }
  html.m-mode .flatpickr-calendar .flatpickr-day { max-width: none; height: 46px; line-height: 46px; font-size: 1rem; flex-basis: 14.2857%; }
  html.m-mode .flatpickr-calendar .flatpickr-months { height: 52px; }
  html.m-mode .flatpickr-calendar .flatpickr-months .flatpickr-prev-month,
  html.m-mode .flatpickr-calendar .flatpickr-months .flatpickr-next-month { height: 52px; width: 52px; padding: 16px; }
  html.m-mode .flatpickr-calendar .flatpickr-current-month { font-size: 112%; padding-top: 12px; }
  html.m-mode body:has(.flatpickr-calendar.open)::after {
    content: ""; position: fixed; inset: 0; z-index: 99998; background: rgba(36,53,43,.45);
  }

  /* ---------- Karten & Listen ---------- */
  html.m-mode .property-grid { gap: 18px; }
  html.m-mode .property-card { border-radius: 18px; }
  html.m-mode .property-card .img-wrap { aspect-ratio: 16/10; }
  html.m-mode .property-card:hover img { transform: none; }
  html.m-mode .property-card-body { padding: 18px; }
  html.m-mode .property-card-body .btn { width: 100%; margin-top: 4px; }
  html.m-mode .property-card-body a.property-price { padding: 6px 0; }
  html.m-mode .property-facts span { font-size: .85rem; padding: 6px 12px; }

  html.m-mode .service-grid { grid-template-columns: 1fr 1fr; gap: 22px 14px; }
  html.m-mode .weather-card { padding: 20px 14px; border-radius: 18px; }
  html.m-mode .weather-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  html.m-mode .weather-temp { font-size: 1.7rem; }
  html.m-mode .split { gap: 28px; }
  html.m-mode .split img { border-radius: 18px; }

  /* ---------- Objektseiten ---------- */
  html.m-mode .facts-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 14px; padding: 22px 0; margin: 26px 0; }
  html.m-mode .booking-cta-card { padding: 24px 20px; border-radius: 18px; margin: 26px 0; gap: 18px; }
  html.m-mode .booking-cta-card .btn-primary { width: 100%; min-height: 56px; font-size: 1.05rem; }
  html.m-mode .booking-cta-card p { max-width: none; }
  html.m-mode .room-types { grid-template-columns: 1fr; gap: 14px; }
  html.m-mode .room-type-card { padding: 20px; border-radius: 16px; }

  html.m-mode .gallery {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -18px; padding: 2px 18px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  html.m-mode .gallery::-webkit-scrollbar { display: none; }
  html.m-mode .gallery img { background: var(--parchment-deep); flex: 0 0 84%; height: 230px; scroll-snap-align: center; border-radius: 16px; }
  html.m-mode .gallery img:hover { transform: none; }

  html.m-mode .testimonial-banner-wrap { padding: 44px 0; }
  html.m-mode .testimonial-banner { margin: 0 -18px; padding: 0 18px 14px; scroll-padding: 0 18px; }
  html.m-mode .testimonial-banner-card { flex-basis: 82%; border-radius: 16px; }
  html.m-mode .events-link-section { padding: 36px 0; }
  html.m-mode .events-link-section .btn { width: 100%; }
  html.m-mode .team-card, html.m-mode .crosspromo-card, html.m-mode .contact-form { border-radius: 18px; }
  html.m-mode .crosspromo-card { padding: 18px; min-height: 64px; }

  /* ---------- Formulare ---------- */
  html.m-mode .contact-form { padding: 22px 18px; }
  html.m-mode .form-row { margin-bottom: 16px; }
  html.m-mode .form-row label { font-size: .92rem; margin-bottom: 7px; }
  html.m-mode .form-row input, html.m-mode .form-row select, html.m-mode .form-row textarea {
    min-height: 54px; font-size: 16px; padding: 13px 14px; border-radius: 12px;
  }
  html.m-mode .form-row textarea { min-height: 150px; }
  html.m-mode .contact-form .btn { width: 100%; min-height: 56px; font-size: 1.05rem; }
  html.m-mode .contact-info-block .info-row { margin-bottom: 22px; }
  html.m-mode .contact-info-block p a { display: inline-block; padding: 4px 0; }

  /* ---------- Fußzeile ---------- */
  html.m-mode footer.site-footer { padding: 44px 0 22px; }
  html.m-mode .footer-grid { gap: 26px; }
  html.m-mode .footer-grid li { margin-bottom: 0; }
  html.m-mode .footer-grid li a, html.m-mode .footer-grid li { display: block; padding: 9px 0; }
  html.m-mode .footer-bottom { flex-direction: column; gap: 6px; }
  html.m-mode .footer-bottom a { display: inline-block; padding: 10px 2px; }
  html.m-mode .m-footer-switch { padding-bottom: 26px; }

  /* ---------- Cookie-Banner ---------- */
  html.m-mode .cookie-banner { padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
  html.m-mode .cookie-banner-actions { width: 100%; }
  html.m-mode .cookie-banner-actions .btn { flex: 1; min-height: 50px; font-size: .95rem; }

  /* ---------- Buchungs-Hilfe / Modal ---------- */
  html.m-mode .booking-modal-overlay { padding: 0; }
  html.m-mode .booking-modal { max-height: 100%; height: 100%; border-radius: 0; }
  html.m-mode .booking-modal-help a { display: inline-block; padding: 8px 0; }

  /* ---------- Bildergalerie Vollbild ---------- */
  html.m-mode .m-lb {
    display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 1500;
    background: rgba(12,18,14,.97); visibility: hidden; opacity: 0; transition: opacity .18s ease, visibility 0s linear .18s;
  }
  html.m-mode .m-lb.is-open { visibility: visible; opacity: 1; transition-delay: 0s; }
  .m-lb-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; color: #fff; flex: none; }
  .m-lb-count { font-weight: 600; font-size: .95rem; letter-spacing: .04em; }
  .m-lb-close { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
  .m-lb-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .m-lb-track::-webkit-scrollbar { display: none; }
  .m-lb-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 0 8px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .m-lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
}

@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  html.m-mode .m-sheet, html.m-mode .m-dock, html.m-mode .m-lb { transition: none; }
}
