/*!
 * FILE: public/assets/ui/css/20-ui-mobile-shell.css
 *
 * PURPOSE / ZWECK:
 * - Responsive Topbar für schmale Desktop-Shells, Tablets und Handys.
 * - Tablet und Handy nutzen einen stabilen Sidebar-Drawer.
 * - Suche bleibt als eindeutiges Icon mit großem App-Dialog erreichbar.
 * - Voice-AI und alle übrigen Aktionen bleiben erreichbar.
 *
 * SCOPE / DOM-VERTRÄGE:
 * - .ev-topbar.evh-topbar mit .evh-left, .evh-search und .evh-actions.
 * - .ev-sidebar, .ev-main und .ev-footer__inner für den mobilen Shell-Umbruch.
 *
 * THEME / RESPONSIVE:
 * - 1100–1399 px: zweizeilige Topbar trotz fester Desktop-Sidebar.
 * - Bis 1099 px: einzeilige Topbar, Such-Icon und horizontal bedienbare Aktionen.
 * - Bis 640/380 px: kompakte, weiterhin vollständige Handy-Bedienung.
 *
 * WARTUNG / ABGRENZUNG:
 * - Keine Funktion entfernen; das Desktop-Suchfeld wird durch den Suchdialog ersetzt.
 * - Scrollbar-Darstellung liegt in 50-ui-responsive-scroll.css.
 * - Keine Fachseiten-, Scheduling-, Datenbank- oder JavaScript-Logik.
 */

.evh-mobile-back {
  display: none;
}

.evh-topbar--public {
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr);
}

.evh-topbar--public .evh-actions {
  grid-column: 2;
}

@media (min-width: 1100px) and (max-width: 1699.98px) {
  .ev-topbar,
  .evh-topbar {
    grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 8px 12px;
    min-height: 0;
    padding-block: 9px;
  }

  .evh-left {
    grid-column: 1;
    grid-row: 1;
  }

  .evh-actions {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-content: flex-end;
    overflow: visible;
  }

  .evh-search,
  .ev-search {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    width: 100%;
    max-width: none;
    visibility: visible;
    opacity: 1;
  }

  .evh-topbar--public {
    grid-template-rows: auto;
    min-height: var(--ev-topbar-h);
  }
}

@media (max-width: 1099.98px) {
  .ev-topbar,
  .evh-topbar {
    grid-template-columns: minmax(165px, auto) minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 8px 10px;
    min-height: 0;
    padding: 9px 11px;
    overflow: visible;
  }

  .evh-left {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .evh-context {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .evh-context-mark {
    width: 38px;
    height: 38px;
  }

  .evh-actions {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  .evh-actions > * {
    flex: 0 0 auto;
  }


  .evh-actions > [data-erva-topbar-open] {
    display: inline-flex;
    visibility: visible;
    opacity: 1;
  }

  .evh-search-open {
    display: inline-flex;
  }

  .evh-topbar > .evh-search,
  .ev-topbar > .ev-search {
    display: none;
  }

  .evh-user-copy,
  .evh-user > .evh-svg {
    display: none;
  }

  .evh-user {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 3px;
  }

  .evh-menu-wrap.is-open .evh-dropdown {
    position: fixed;
    top: 68px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }

  .ev-main {
    width: 100%;
    padding: 16px 12px 34px;
  }

  .ev-footer__inner {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 11px;
    padding: 15px 12px;
  }

  .ev-footer__nav,
  .ev-footer__meta {
    justify-content: flex-start;
  }

  .ev-page-header {
    flex-direction: column;
    padding: 18px;
  }

  .ev-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1099.98px) {
  .evh-mobile-menu,
  .ev-mobile-menu,
  .evh-mobile-back {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .ev-sidebar {
    width: min(330px, 90vw);
    max-width: min(330px, 90vw);
    transform: translateX(-105%);
    box-shadow: var(--ev-shadow-lg);
  }

  body.ev-sidebar-open .ev-sidebar { transform: translateX(0); }

  .ev-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1490;
    display: none;
    border: 0;
    background: rgba(15, 23, 42, .58);
  }

  body.ev-sidebar-open .ev-sidebar-backdrop { display: block; }

  .ev-shell,
  body.ev-sidebar-collapsed .ev-shell { margin-left: 0; }

  .evh-mobile-menu,
  .ev-mobile-menu,
  .evh-mobile-back { display: inline-flex; }
}

@media (max-width: 640px) {
  .ev-sidebar {
    width: min(320px, 88vw);
    max-width: min(320px, 88vw);
  }

  .ev-topbar,
  .evh-topbar {
    grid-template-columns: minmax(44px, auto) minmax(0, 1fr);
    padding: 8px 9px;
  }

  .evh-context-copy {
    display: none;
  }

  .evh-actions {
    width: 100%;
    max-width: none;
  }

  .evh-search,
  .ev-search {
    min-height: 40px;
  }

  .evh-search-dialog__panel {
    margin-top: clamp(26px, 7vh, 72px);
  }

  .ev-main {
    padding: 11px 9px 28px;
  }

  .ev-footer__inner {
    padding-inline: 10px;
  }

  body.ui-app {
    padding-bottom: calc(var(--ev-mobile-dock-h) + env(safe-area-inset-bottom, 0px) + 10px);
  }

  /*
   * The reservation module owns its phone primary action. Only that flow drops
   * the competing global dock; every other public and operational page keeps it.
   */
  body:has(#restaurantReservationsApp) {
    padding-bottom: 0;
  }

  body:has(#restaurantReservationsApp) .ev-mobile-dock {
    display: none;
  }

  body:has(#restaurantReservationsApp) .evh-topbar {
    position: sticky;
    top: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
  }

  body:has(#restaurantReservationsApp) .evh-left,
  body:has(#restaurantReservationsApp) .evh-actions {
    gap: 5px;
  }

  body:has(#restaurantReservationsApp) .evh-actions {
    width: auto;
    overflow: visible;
  }

  body:has(#restaurantReservationsApp) .evh-context {
    grid-template-columns: 34px;
  }

  body:has(#restaurantReservationsApp) .evh-context-mark {
    width: 34px;
    height: 34px;
  }

  body:has(#restaurantReservationsApp) .evh-voice-button,
  body:has(#restaurantReservationsApp) .evh-phone-demo,
  body:has(#restaurantReservationsApp) [data-ever-theme-toggle] {
    display: none;
  }

  body:has(#restaurantReservationsApp) .evh-menu-wrap.is-open .evh-dropdown {
    top: calc(var(--ev-topbar-h) + env(safe-area-inset-top, 0px));
  }
}

@media (max-width: 520px) {
  .evh-search-dialog {
    align-items: start;
    padding: calc(var(--ev-topbar-h) + env(safe-area-inset-top, 0px) + 10px) 8px 8px;
  }

  .evh-search-dialog__panel {
    width: 100%;
    margin-top: 0;
    padding: 15px;
    border-radius: 16px;
  }

  .evh-search-dialog__form {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .evh-search-dialog__submit {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 380px) {
  .evh-actions {
    gap: 5px;
  }

  .evh-icon-btn,
  .evh-user {
    width: 44px;
    min-width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .evh-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .evh-mobile-back,
  .evh-context { display: none; }

  [data-ui-topbar][data-auth-chrome-fallback="1"] .evh-context {
    display: grid;
    grid-template-columns: 44px;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  [data-ui-topbar][data-auth-chrome-fallback="1"] .evh-context-mark {
    width: 44px;
    height: 44px;
  }

  [data-ui-topbar][data-auth-chrome-fallback="1"] .evh-context-copy {
    display: none;
  }
}

html.ev-sidebar-drawer-lock,
html.ev-sidebar-drawer-lock body { overflow: hidden; overscroll-behavior: none; }
