/* Iseld v11: robust mobilvisning for offentlig booking.
   max-device-width fanger iPhone/Safari selv når nettleseren ber om desktop-visning. */
@media screen and (max-width: 760px),
       screen and (max-device-width: 900px),
       screen and (hover: none) and (pointer: coarse) and (max-width: 1100px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: clip !important;
  }

  #publicBookingView.booking-view {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 100svh !important;
    padding: max(12px, env(safe-area-inset-top)) 12px max(22px, env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  #publicBookingView.booking-view.hidden {
    display: none !important;
  }

  #publicBookingView .booking-admin-edit-bar,
  #publicBookingView .booking-theme-title,
  #publicBookingView .booking-theme-switcher,
  #publicBookingView .booking-shell {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
    box-sizing: border-box !important;
  }

  #publicBookingView .booking-theme-title {
    position: static !important;
    margin: 0 0 7px !important;
    text-align: left !important;
  }

  #publicBookingView .booking-theme-switcher {
    position: static !important;
    display: flex !important;
    gap: 7px !important;
    padding: 0 0 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    justify-content: flex-start !important;
    scrollbar-width: none;
  }

  #publicBookingView .booking-theme-switcher::-webkit-scrollbar {
    display: none;
  }

  #publicBookingView .theme-preview-btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  #publicBookingView .booking-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  #publicBookingView .booking-brand-panel,
  #publicBookingView .booking-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 18px !important;
    border-radius: 22px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    transform: none !important;
  }

  #publicBookingView .booking-brand-panel::before,
  #publicBookingView .booking-brand-panel::after {
    max-width: 45vw !important;
    pointer-events: none !important;
  }

  #publicBookingView .booking-brand-top {
    margin: 0 0 10px !important;
  }

  #publicBookingView .booking-brand-top img {
    width: auto !important;
    height: 56px !important;
    max-width: 150px !important;
    object-fit: contain !important;
  }

  #publicBookingView .booking-welcome-chip {
    margin-bottom: 12px !important;
  }

  #publicBookingView .booking-brand-panel h1,
  #publicBookingView .booking-card h2 {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  #publicBookingView .booking-brand-panel h1 {
    font-size: clamp(31px, 10vw, 42px) !important;
    line-height: 1.02 !important;
    margin: 0 0 11px !important;
  }

  #publicBookingView .booking-brand-panel p {
    max-width: none !important;
    font-size: 15px !important;
    line-height: 1.48 !important;
  }

  #publicBookingView .booking-trust-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 7px !important;
    margin-top: 15px !important;
  }

  #publicBookingView .booking-trust-item {
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
  }

  #publicBookingView .booking-card-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px !important;
    gap: 10px !important;
    align-items: start !important;
  }

  #publicBookingView .booking-card h2 {
    font-size: clamp(29px, 9vw, 38px) !important;
    line-height: 1.04 !important;
  }

  #publicBookingView .booking-close-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    padding: 0 !important;
  }

  #publicBookingView .booking-grid,
  #publicBookingView .booking-input-grid,
  #publicBookingView .public-nearest-grid,
  #publicBookingView .public-time-search-row {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #publicBookingView .booking-step,
  #publicBookingView .booking-service-card,
  #publicBookingView .booking-date-card,
  #publicBookingView .booking-slot-card,
  #publicBookingView .booking-loading-card,
  #publicBookingView .public-simple-booking-panel,
  #publicBookingView .booking-choice-panel,
  #publicBookingView .booking-field,
  #publicBookingView .booking-field input,
  #publicBookingView .booking-field select,
  #publicBookingView .booking-field textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #publicBookingView .booking-field input,
  #publicBookingView .booking-field select,
  #publicBookingView .booking-field textarea {
    font-size: 16px !important;
  }

  #publicBookingView .booking-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px !important;
  }

  #publicBookingView .booking-actions button,
  #publicBookingView .booking-primary-btn,
  #publicBookingView .booking-secondary-btn,
  #publicBookingView .booking-mini-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    box-sizing: border-box !important;
  }
}

@media screen and (max-width: 390px), screen and (max-device-width: 390px) {
  #publicBookingView.booking-view {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }

  #publicBookingView .booking-brand-panel,
  #publicBookingView .booking-card {
    padding: 16px !important;
    border-radius: 20px !important;
  }
}
