/*
 * Nauti Reservations — shared mobile styles v3
 * Injected via index.php <head> for ALL pages (main + inner/iframe).
 */

@media(max-width:768px){
 body.rr-direct-business .banner .acct>summary{min-height:44px;box-sizing:border-box;background:#edf7f3;border:1px solid #b8d4ca;border-radius:8px;color:#245b54}
 body.rr-direct-business .banner .acct-avatar{background:#e3f1eb;color:#245b54;border-color:#b8d4ca}
 body.rr-direct-business .banner .acct .nav-drop-caret{color:#245b54}
 body.rr-direct-business .banner .acct{position:relative;flex:none;min-width:0}
 body.rr-direct-business .banner .acct-menu{position:absolute;right:0;top:calc(100% + 8px);width:min(280px,calc(100vw - 24px));min-width:0;max-width:calc(100vw - 24px);max-height:calc(100dvh - 100px);overflow:auto;border:1px solid #b8d4ca;border-radius:9px;background:#fff;box-shadow:0 8px 24px #163b4b26}
 body.rr-direct-business .banner .acct-menu a{min-height:44px;box-sizing:border-box;white-space:normal}
}

/* ═══════════════════════════════════════════════════════════════
   FULL HEIGHT
   ═══════════════════════════════════════════════════════════════ */
html {
  height: 100%;
  height: 100dvh;
}
body {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > .wrap,
body > .wrap--flush {
  flex: 1;
  min-height: 0;
}
body > .wrap .card,
body > .wrap--flush .card {
  min-height: 0;
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL — applies to every page
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Prevent iOS auto-zoom on input focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  input[type="url"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Minimum 44 × 44 px touch targets */
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
  select,
  textarea {
    min-height: 44px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  button, .btn, [role="button"] { min-height: 44px; }
  .btn { display: inline-flex !important; align-items: center; justify-content: center; }

  /* Tables scroll horizontally */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  th, td { white-space: nowrap; }

  /* Page padding */
  .wrap { padding: 10px 10px !important; }
  .wrap--flush { padding: 0 !important; }

  /* Small cards fill screen width */
  .card--sm { --card-max: 100% !important; margin: 0 !important; }

  /* Forms: full width on mobile */
  form[style*="max-width:320px"], form[style*="max-width: 320px"],
  form[style*="max-width:360px"], form[style*="max-width: 360px"],
  form[style*="max-width:480px"], form[style*="max-width: 480px"],
  form[style*="max-width:560px"], form[style*="max-width: 560px"],
  form[style*="max-width:600px"], form[style*="max-width: 600px"] {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Flex rows that hold buttons — allow wrap */
  div[style*="display:flex"][style*="gap:10px"],
  div[style*="display:flex"][style*="gap: 10px"] {
    flex-wrap: wrap;
  }

  /* Business list & admin dashboard iframes: fill screen, scroll freely */
  #biz-frame,
  #adm-frame {
    /* banner is now 56px on mobile */
    height: calc(100dvh - 56px) !important;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Calendar full height */
  #cal-wrap, .cal-outer {
    height: calc(100dvh - 56px) !important;
    min-height: 0;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  #biz-frame, #adm-frame {
    height: calc(100dvh - 52px) !important;
  }
  #cal-wrap, .cal-outer {
    height: calc(100dvh - 52px) !important;
  }
}

/* Shared phone-width constraints; controls keep their own padding inside the screen. */
@media(max-width:768px){
 *,*::before,*::after{box-sizing:border-box}
 html,body{max-width:100%;min-width:0}
 main,.owner-shell,.owner-shell-main,.wrap,.wrap--flush{min-width:0;max-width:100%}
 img,video,canvas{max-width:100%}
 input:not([type=checkbox]):not([type=radio]),select,textarea{max-width:100%;min-width:0}
 .nav-drawer a[href$="/messages"]{display:flex!important;align-items:center;gap:8px;white-space:nowrap}
 .nav-drawer a[href$="/messages"] .drawer-badge{flex:none;margin-left:auto}
 .rm-summary,.rm-message,.rm-message p,.rm-meta,.rm-composer{min-width:0;max-width:100%;overflow-wrap:anywhere}
 .rm-trip-overlay{width:100vw!important;height:100dvh!important;max-width:100vw!important;max-height:100dvh!important;margin:0;border-radius:0;padding:0}
 body:has(#inbox-workspace) .owner-shell-main{padding:12px!important}
 #inbox-tools{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-bottom:12px}
 #inbox-tools .inbox-search{grid-column:1/-1;min-width:0}
 #inbox-tools .inbox-filter{justify-content:center;min-width:0;white-space:nowrap;padding:10px 8px}
 #inbox-workspace{min-width:0;max-width:100%;border-radius:10px}
 #inbox-reading .rm-summary h3{font-size:19px;line-height:1.35;clear:both;overflow-wrap:anywhere}
 #inbox-reading .rm-actions{display:flex;flex-wrap:wrap;gap:8px}
 #inbox-reading .rm-actions>*{max-width:100%;min-width:0}
}
@media(max-width:700px){
 dialog[data-rr-window]{width:100vw!important;height:100dvh!important;max-width:100vw!important;max-height:100dvh!important;margin:0!important;border-radius:0!important;inset:0!important}
 .rr-book-embed #cp-right,#cp-right.open{max-width:100vw!important;min-width:0!important;padding:12px!important;box-sizing:border-box}
 #cp-right #cp-drawer-body{min-width:0;max-width:100%;padding:0!important}
 #cp-right #cp-drawer-header{gap:10px;padding:10px 0;margin-bottom:10px}
 #cp-right #cp-book-title{font-size:19px!important;line-height:1.35;padding-right:30px;overflow-wrap:anywhere}
 #cp-right #cp-booking-who{font-size:18px!important;line-height:1.35;overflow-wrap:anywhere}
 #cp-right #cp-booking-when{font-size:14px!important;line-height:1.5}
 #cp-right input:not([type=checkbox]):not([type=radio]),#cp-right select,#cp-right textarea{width:100%;box-sizing:border-box;font-size:16px!important}
 #cp-right .cp-contact-grid{grid-template-columns:minmax(0,1fr)}
 #cp-right .cp-form-row{min-width:0;max-width:100%}
 #cp-right #cp-step-indicator{overflow-x:auto;max-width:100%;min-width:0;scrollbar-width:none;gap:6px}
 #cp-right #cp-step-indicator>*{flex-shrink:0}
}
@media(max-width:700px){
 #cp-right #cp-book-title{display:flex;flex-wrap:wrap;align-items:center;gap:5px 8px;overflow:visible!important;white-space:normal!important;text-overflow:clip!important}
 #cp-right #cp-book-title>span:first-child{display:block;flex:1 0 100%;min-width:0;max-width:100%;white-space:normal!important;text-overflow:clip!important;overflow:visible!important;font-size:17px;line-height:1.35}
 #cp-right #cp-book-title .cp-banner-separator{display:none}
 #cp-right #cp-book-title>a{font-size:13px}
 #cp-right #cp-book-title .cp-banner-message{min-height:36px;padding:6px 10px;font-size:13px}
 #cp-right .cp-departure-option{flex-direction:column!important;align-items:stretch!important;gap:10px!important;padding:12px!important}
 #cp-right .cp-departure-option>.cp-departure-badge{align-self:flex-start}
}

@media(max-width:700px){body.rr-interior .banner>.banner-center{display:none!important}}
