/* ============================================================
   DATA DOCTOR HUB — PHASE 4
   MOBILE NAVIGATION + CONVERSION + TOUCH USABILITY
   Six service pages only. Desktop is untouched.
   ============================================================ */

/* Desktop Isolation: Never display action bar on desktop/laptop */
@media (min-width: 768px) {
  .mobile-action-bar {
    display: none !important;
  }
}

@media (max-width: 767px) {

  :root {
    --mi-ink: #19343D;
    --mi-teal: #078F80;
    --mi-teal-dark: #086B62;
    --mi-cream: #FBF8F0;
  }

  /* Keep page content clear of the fixed bottom action bar */
  body:has(.mobile-service-experience) {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  /* ----------------------------------------------------------
     1. FIXED MOBILE ACTION BAR
     ---------------------------------------------------------- */

  .mobile-action-bar[hidden] {
    display: none !important;
  }

  .mobile-action-bar {
    position: fixed;
    z-index: 1200;
    left: 0;
    right: 0;
    bottom: 0;

    display: grid;
    grid-template-columns: .85fr .85fr 1.3fr;
    align-items: center;
    gap: 8px;

    padding: 10px 13px calc(10px + env(safe-area-inset-bottom, 0px));

    background: rgba(250, 249, 243, .94);
    border-top: 1px solid rgba(25,52,61,.10);
    box-shadow: 0 -8px 28px rgba(25,52,61,.09);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition:
      transform .22s ease,
      opacity .22s ease,
      visibility .22s ease;
  }

  .mobile-action-bar.is-hidden {
    transform: translateY(110%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .mobile-action-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-width: 0;
    min-height: 47px;
    padding: 9px 8px;

    border-radius: 14px;
    text-decoration: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;

    -webkit-tap-highlight-color: transparent;
    transition: transform .16s ease;
  }

  .mobile-action-bar a:active {
    transform: scale(.97);
  }

  .mobile-action-bar .mobile-action-call {
    color: var(--mi-ink);
    background: #E8EEE8;
    border: 1px solid rgba(25,52,61,.07);
  }

  .mobile-action-bar .mobile-action-wa {
    color: #08745F;
    background: #E0F1E6;
    border: 1px solid rgba(8,116,95,.10);
  }

  .mobile-action-bar .mobile-action-book {
    color: #fff;
    background: linear-gradient(115deg, #079C89, #087367);
    box-shadow: 0 6px 15px rgba(7,143,128,.20);
  }

  .mobile-action-bar svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
  }

  /* ----------------------------------------------------------
     2. TABLET HIGHLIGHTS — NO MORE TINY FOUR-COLUMN STRIP
     ---------------------------------------------------------- */

  @media (min-width: 700px) and (max-width: 767px) {

    .mobile-service-experience .m-hero-section .m-highlights-grid {
      grid-area: highlights;
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 10px;
      width: 100%;
      margin-top: 16px;
    }

    .mobile-service-experience .m-hero-section .m-highlight-item {
      display: flex !important;
      flex-direction: row;
      align-items: center;
      min-height: 66px;
      padding: 12px;
      border-radius: 15px;
    }

    .mobile-service-experience .m-hero-section .m-hl-text span {
      display: block !important;
      font-size: 10px;
      line-height: 1.4;
    }

    .mobile-service-experience .m-hero-section .m-hl-text strong {
      font-size: 11px;
    }

    .mobile-service-experience .m-hero-section .m-hl-icon {
      flex: 0 0 30px;
      width: 30px;
      height: 30px;
    }
  }

  /* ----------------------------------------------------------
     3. HEADER TOUCH TARGETS
     ---------------------------------------------------------- */

  .topbar .nav-actions .icon-btn,
  .topbar .menu-toggle {
    min-width: 42px;
    min-height: 42px;
  }

  .drawer-panel a,
  .drawer-panel button {
    min-height: 46px;
  }

  /* ----------------------------------------------------------
     4. FORM USABILITY
     ---------------------------------------------------------- */

  .story-book {
    scroll-margin-top: 82px;
  }

  .story-book .story-field input,
  .story-book .story-field select,
  .story-book .story-field textarea {
    min-height: 50px;
    font-size: 16px !important;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
  }

  .story-book .story-field textarea {
    min-height: 100px;
    resize: vertical;
  }

  .story-book .story-actions button,
  .story-book .story-actions a {
    min-height: 50px;
  }

  .story-book input:focus-visible,
  .story-book select:focus-visible,
  .story-book textarea:focus-visible,
  .story-book button:focus-visible,
  .mobile-action-bar a:focus-visible {
    outline: 3px solid rgba(7,143,128,.35);
    outline-offset: 3px;
  }

  /* ----------------------------------------------------------
     5. SMALL PHONE LAYOUT
     ---------------------------------------------------------- */

  @media (max-width: 360px) {
    .mobile-action-bar {
      gap: 6px;
      padding-inline: 9px;
    }

    .mobile-action-bar a {
      min-height: 45px;
      padding-inline: 5px;
      font-size: 10px;
      gap: 4px;
    }

    .mobile-action-bar svg {
      width: 14px;
      height: 14px;
      flex-basis: 14px;
    }
  }

  /* ----------------------------------------------------------
     6. ACCESSIBILITY
     ---------------------------------------------------------- */

  @media (prefers-reduced-motion: reduce) {
    .mobile-action-bar,
    .mobile-action-bar a {
      transition: none !important;
    }
  }
}
