/* ============================================================
   MOBILE HEADER / NAVIGATION FIX
   Responsive mobile navigation for <=768px
   Keeps desktop completely untouched
   ============================================================ */

@media (max-width: 768px) {

  /* ============================================================
     Prevent horizontal overflow globally
     ============================================================ */
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  * {
    box-sizing: border-box;
  }

  /* ============================================================
     MOBILE HEADER LAYOUT
     ============================================================ */
  header.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    max-width: 100%;

    padding: 12px 16px;

    position: relative;
    z-index: 1000;

    overflow: hidden;
  }

  /* ============================================================
     HIDE DESKTOP NAVIGATION LINKS
     ============================================================ */
  header.app-header nav,
  header.app-header .nav-links,
  header.app-header .desktop-nav,
  header.app-header .menu-links,
  header.app-header ul {
    display: none !important;
  }

  /* ============================================================
     OPTIONAL: HIDE DESKTOP CTA/RATING
     ============================================================ */
  header.app-header .rating-pill,
  header.app-header .desktop-cta,
  header.app-header .book-btn-desktop {
    display: none !important;
  }

  /* ============================================================
     KEEP ONLY:
     - doctor branding
     - hamburger menu
     ============================================================ */

  /* Doctor branding block */
  header.app-header .brand,
  header.app-header .logo-wrap,
  header.app-header .doctor-brand {
    display: flex;
    align-items: center;
    gap: 10px;

    max-width: calc(100% - 60px);
  }

  /* ============================================================
     HAMBURGER BUTTON
     ============================================================ */
  header.app-header #menuBtn {
    display: flex !important;

    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    min-width: 42px;

    border-radius: 10px;

    background: transparent;
    border: 1px solid rgba(0,0,0,0.08);

    cursor: pointer;

    position: relative;
    z-index: 1200;
  }

  /* Hamburger icon */
  header.app-header #menuBtn svg,
  header.app-header #menuBtn i {
    width: 22px;
    height: 22px;
  }

  /* ============================================================
     OVERLAY BACKGROUND
     ============================================================ */
  #menuOverlay {
    display: none;

    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.45);

    backdrop-filter: blur(2px);

    z-index: 1100;
  }

  #menuOverlay.active {
    display: block;
  }

  /* ============================================================
     MOBILE DRAWER PANEL
     ============================================================ */
  #mobileMenu {
    position: fixed;

    top: 0;
    right: -100%;

    width: 82%;
    max-width: 340px;

    height: 100vh;

    background: #ffffff;

    box-shadow: -8px 0 30px rgba(0,0,0,0.12);

    transition: right 0.32s ease;

    z-index: 1200;

    overflow-y: auto;

    padding: 24px 20px;
  }

  /* Drawer active state */
  #mobileMenu.active {
    right: 0;
  }

  /* ============================================================
     CLOSE BUTTON
     ============================================================ */
  #closeMenuBtn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    margin-left: auto;
    margin-bottom: 20px;

    border: none;
    background: transparent;

    cursor: pointer;
  }

  /* ============================================================
     MOBILE NAVIGATION LINKS
     ============================================================ */
  #mobileMenu nav {
    display: flex;
    flex-direction: column;

    gap: 6px;

    margin-top: 10px;
  }

  #mobileMenu nav a {
    display: flex;
    align-items: center;

    width: 100%;

    padding: 14px 10px;

    border-radius: 10px;

    text-decoration: none;

    color: #1A1F2E;

    font-size: 16px;
    font-weight: 500;

    transition: all 0.2s ease;
  }

  #mobileMenu nav a:hover,
  #mobileMenu nav a:focus-visible {
    background: rgba(0,0,0,0.05);
  }

  /* ============================================================
     MOBILE CTA INSIDE DRAWER
     ============================================================ */
  #mobileMenu .btn-gold {
    margin-top: 20px;

    width: 100%;

    justify-content: center;
  }

  /* ============================================================
     PREVENT BACKGROUND SCROLL
     ============================================================ */
  body.drawer-open {
    overflow: hidden;
    touch-action: none;
  }

  /* ============================================================
     FIX STICKY BOTTOM BUTTONS
     ============================================================ */
  .mbar {
    display: flex;
    flex-direction: column;

    gap: 10px;

    width: 100%;

    padding: 12px 16px;

    overflow: hidden;
  }

  .mbar .btn {
    width: 100%;
    max-width: 100%;

    min-height: 46px;

    font-size: 14px;

    justify-content: center;
  }

  /* ============================================================
     HERO SECTION WIDTH FIX
     ============================================================ */
  section,
  .hero,
  .hero-content,
  .container,
  .wrapper {
    width: 100%;
    max-width: 100%;

    overflow-x: hidden;
  }

  /* Remove accidental overflow from images/cards */
  img,
  video,
  iframe,
  .card,
  .photo-frame {
    max-width: 100%;
  }

  /* ============================================================
     HERO TRUST/INFO CLEAN-UP
     - drop the ECG trace behind the hero text
     - reorganise the trust strip into clean stacked rows
     ============================================================ */
  section.hairline-bg .hero-ecg,
  section.hairline-bg .hero-cross {
    display: none !important;
  }

  /* Tighter, calmer trust strip on mobile. */
  section.hairline-bg .trust-strip {
    row-gap: 8px;
    column-gap: 0.6rem;
    font-size: 13.5px;
    line-height: 1.55;
  }

  /* First trust-strip layout:
       1) rating  ·  reviews   (stay on row 1)
       2) timing  (forced onto row 2, with the leading dot hidden) */
  section.hairline-bg .trust-strip:first-child > :nth-child(4) {
    display: none;
  }

  section.hairline-bg .trust-strip:first-child > :nth-child(5) {
    flex-basis: 100%;
    margin: 0;
  }

  /* Fees row: align the check icon to the top so wrapped text reads cleanly. */
  section.hairline-bg .trust-strip:last-child > span {
    align-items: flex-start;
  }

  section.hairline-bg .trust-strip:last-child svg {
    margin-top: 4px;
  }

  /* A touch more breathing room between the rating block and the fees row. */
  section.hairline-bg .mt-10 {
    margin-top: 1.75rem !important;
  }

  section.hairline-bg .mt-10.flex.flex-col {
    gap: 10px !important;
  }
}