/* ============================================
   COMPREHENSIVE CARDIOLOGY — MOBILE STYLES
   Applies to all pages via <link> tag
   ============================================ */

/* ── GLOBAL OVERFLOW FIX ── */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  max-width: 100%;
}

/* ── HAMBURGER BUTTON ── */
#mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
#mobile-menu-btn:hover { background: var(--gray-100, #eef1f5); }
#mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy, #1a2b4a);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}
#mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#mobile-menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE NAV DRAWER ── */
#mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9990;
  background: rgba(15, 30, 53, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
#mobile-nav.open {
  opacity: 1;
  pointer-events: all;
}
#mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--white, #fff);
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
#mobile-nav.open #mobile-nav-panel {
  transform: translateX(0);
}
#mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100, #eef1f5);
  flex-shrink: 0;
}
#mobile-nav-header .nav-brand {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy, #1a2b4a);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#mobile-nav-header .nav-brand span {
  color: var(--crimson, #c0182a);
  display: block;
}
#mobile-nav-close {
  width: 36px; height: 36px;
  background: var(--gray-50, #f8f9fb);
  border: none; border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--navy, #1a2b4a);
  font-size: 1.2rem;
  transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
#mobile-nav-close:hover { background: var(--gray-100, #eef1f5); }
#mobile-nav-links {
  flex: 1;
  padding: 16px 0;
  list-style: none;
}
#mobile-nav-links li a {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--navy, #1a2b4a);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
#mobile-nav-links li a:hover,
#mobile-nav-links li a.active {
  background: var(--crimson-light, #f9e8ea);
  color: var(--crimson, #c0182a);
  border-left-color: var(--crimson, #c0182a);
}
#mobile-nav-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--gray-100, #eef1f5);
  flex-shrink: 0;
}
#mobile-nav-footer a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--crimson, #c0182a);
  color: #fff;
  padding: 14px 20px;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
#mobile-nav-footer a:hover { background: var(--crimson-hover, #a01020); }

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 900px) {
  /* Show hamburger, hide desktop nav */
  #mobile-menu-btn { display: flex; }
  nav .navbar { display: none !important; }
  .topbar { display: none; }

  /* Header adjustments */
  .header-inner {
    padding: 0 16px !important;
    height: 64px !important;
  }

  /* Hide desktop header CTA on very small screens */
  .header-cta { display: none; }

  /* Hero */
  .hero { min-height: 60vh; }
  .hero-content { padding: 48px 20px !important; }
  .hero h1 { font-size: 2.2rem !important; }
  .hero-sub { font-size: 0.95rem !important; }
  .btn-hero-primary { padding: 14px 24px; font-size: 0.9rem; }

  /* Containers */
  .container { padding: 48px 20px !important; }

  /* Carousel — single card on mobile */
  .carousel-track .service-card {
    min-width: calc(100vw - 40px) !important;
    max-width: calc(100vw - 40px);
  }
  .carousel-wrapper { overflow: hidden; }

  /* Team grid — 2 columns on tablet */
  .team-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }

  /* Contact grid — single column */
  .contact-grid {
    grid-template-columns: 1fr !important;
  }

  /* Footer */
  .footer-cols {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Profile pages */
  .page-body {
    grid-template-columns: 1fr !important;
    padding: 40px 20px !important;
  }
  .profile-hero { padding: 40px 20px !important; }
  .profile-hero-inner { gap: 24px !important; }
  .profile-photo, .profile-photo-placeholder {
    width: 120px !important;
    height: 120px !important;
    font-size: 2.2rem !important;
  }
  .profile-info h1 { font-size: 1.8rem !important; }
  .sidebar { order: -1; }

  /* Locations page */
  .locations-section {
    grid-template-columns: 1fr !important;
    padding: 40px 20px !important;
    gap: 24px !important;
  }

  /* New patient page */
  .steps { gap: 12px !important; }
  .forms-grid { grid-template-columns: 1fr !important; }
  .bring-grid { grid-template-columns: 1fr 1fr !important; }
  .breadcrumb { padding: 10px 20px !important; }
}

@media (max-width: 600px) {
  /* Team grid — single column on phones */
  .team-grid {
    grid-template-columns: 1fr !important;
  }
  .team-member img {
    width: 120px !important;
    height: 120px !important;
  }

  /* Footer single column */
  .footer-cols {
    grid-template-columns: 1fr !important;
  }

  /* Bring grid single column */
  .bring-grid {
    grid-template-columns: 1fr !important;
  }

  /* Section titles */
  .section-title { font-size: 1.6rem !important; }

  /* Profile badges wrap nicely */
  .profile-badges { gap: 8px !important; }
  .badge { font-size: 0.72rem !important; padding: 5px 10px !important; }

  /* Stat grid on Dr. Uricchio page */
  .stat-grid { grid-template-columns: 1fr 1fr !important; }

  /* Contact cards */
  .contact-card { padding: 18px !important; }

  /* Hero */
  .hero-content { padding: 40px 16px !important; }
  .hero h1 { font-size: 1.9rem !important; }
}

/* ── TOUCH IMPROVEMENTS ── */
@media (hover: none) {
  /* Bigger tap targets on touch devices */
  .btn-directions,
  .btn-hero-primary,
  .btn-sidebar,
  .btn-cta,
  .header-cta {
    min-height: 48px;
  }
  .cc-qr { padding: 0.5rem 1rem !important; }
  #cc-send { width: 44px !important; height: 44px !important; }
  #cc-chat-btn { width: 60px !important; height: 60px !important; }
}
