/* ============================================
   Insurance Near Me — Mobile Optimization Layer
   Loaded AFTER page-specific styles. Fixes touch
   targets, readability, and adds sticky call CTA.
   ============================================ */

/* ---- FLOATING STICKY "CALL NOW" — appears on ALL pages under 900px ---- */
.floating-call {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9999;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: #fff;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 86, 179, 0.4), 0 2px 6px rgba(0,0,0,0.15);
  display: none;
  align-items: center;
  gap: 8px;
  border: 2px solid rgba(255,255,255,0.25);
  transition: transform 0.15s;
}
.floating-call:hover, .floating-call:active {
  transform: scale(1.05);
  color: #fff;
  text-decoration: none;
}
.floating-call::before {
  content: "📞";
  font-size: 18px;
}
@media (max-width: 900px) {
  .floating-call { display: inline-flex; }
  /* Push page content up so floating button doesn't cover form buttons */
  body { padding-bottom: 80px; }
}

/* ---- HAMBURGER MENU for homepage nav ---- */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid #14607a;
  color: #14607a;
  padding: 8px 12px;
  font-size: 20px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.mobile-nav-toggle:active { transform: scale(0.95); }

@media (max-width: 900px) {
  /* Show hamburger, hide desktop nav by default */
  .topnav {
    flex-wrap: wrap;
    padding: 12px 16px !important;
  }
  .topnav .mobile-nav-toggle { display: inline-block; }
  .topnav .navlinks {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0 !important;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    margin-top: 12px;
  }
  .topnav.mobile-open .navlinks { display: flex; }
  .topnav .navlinks > a,
  .topnav .navlinks > .has-dropdown > .dropdown-toggle {
    display: block;
    padding: 14px 4px !important;
    font-size: 16px !important;
    border-bottom: 1px solid #f0f2f5;
    width: 100%;
    text-align: left;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    color: #14607a;
  }
  .topnav .navlinks .has-dropdown {
    width: 100%;
    border-bottom: 1px solid #f0f2f5;
  }
  .topnav .navlinks .has-dropdown > .dropdown-toggle {
    border-bottom: none;
  }
  .topnav .navlinks .dropdown-menu {
    position: static !important;
    display: none;
    box-shadow: none !important;
    background: #f8fafb;
    padding: 4px 0 8px 16px !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 0 8px 0 !important;
  }
  .topnav .navlinks .has-dropdown.open .dropdown-menu { display: block; }
  .topnav .navlinks .dropdown-menu a {
    padding: 12px 8px !important;
    font-size: 15px !important;
    display: block;
    border-bottom: 1px solid #e5e7eb;
  }
}

/* ---- CALLSTRIP: cleaner mobile layout ---- */
@media (max-width: 640px) {
  .callstrip {
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px !important;
    font-size: 14px !important;
    text-align: center;
  }
  .callstrip a { font-size: 16px; font-weight: 800; }
  .callstrip .hours { font-size: 12px; opacity: 0.9; }
}

/* ---- LANDING PAGE MOBILE POLISH ---- */
@media (max-width: 640px) {
  /* Top bar phone link — bigger tap target */
  .top-bar {
    padding: 12px 12px !important;
  }
  .top-bar .phone {
    font-size: 1.05rem !important;
    display: block;
    line-height: 1.3;
  }

  /* Hero */
  .hero {
    padding: 32px 16px 28px !important;
  }
  .hero h1 {
    font-size: 1.55rem !important;
    line-height: 1.25 !important;
  }
  .hero .sub {
    font-size: 1rem !important;
    line-height: 1.5;
  }

  /* Trust row — stack vertically for readability */
  .trust-row {
    flex-direction: column;
    gap: 6px !important;
    font-size: 0.9rem !important;
    text-align: left;
    max-width: 320px;
    margin: 12px auto 0;
  }
  .trust-row span {
    display: block;
  }

  /* CTA buttons — full width and larger tap target */
  .cta-group {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .btn {
    width: 100%;
    padding: 15px 20px !important;
    font-size: 1.05rem !important;
    min-height: 48px;
  }

  /* Content sections */
  .container {
    padding: 28px 16px !important;
  }
  .container h2 {
    font-size: 1.35rem !important;
    line-height: 1.3;
    margin-top: 12px !important;
  }
  .container h3 {
    font-size: 1.1rem !important;
    line-height: 1.3;
  }
  .container p, .container li {
    font-size: 1rem !important;
    line-height: 1.65 !important;
  }
  .container ul {
    margin-left: 18px !important;
  }

  /* Highlight box */
  .highlight {
    padding: 14px 16px !important;
    margin: 20px 0 !important;
    font-size: 0.98rem;
  }

  /* Lead form */
  .lead-form-wrap {
    padding: 22px 14px !important;
    margin: 22px -4px !important;
    border-radius: 6px;
  }
  .lead-form input,
  .lead-form select,
  .lead-form textarea {
    padding: 14px !important;
    font-size: 16px !important; /* 16px avoids iOS zoom-in on focus */
    min-height: 48px;
  }
  .lead-form textarea { min-height: 90px; }
  .lead-form button {
    padding: 16px !important;
    font-size: 1.1rem !important;
    min-height: 52px;
  }

  /* Testimonials */
  .testimonial {
    padding: 16px !important;
  }
  .testimonial p {
    font-size: 1rem !important;
    line-height: 1.55;
  }

  /* FAQ */
  .faq-item {
    padding: 14px 0 !important;
  }
  .faq-item h3 {
    font-size: 1.05rem !important;
    line-height: 1.35;
  }

  /* Bottom CTA banner */
  .cta-banner {
    padding: 32px 16px !important;
  }
  .cta-banner h2 {
    font-size: 1.4rem !important;
    line-height: 1.3;
  }
  .cta-banner p {
    font-size: 1rem !important;
  }

  /* Footer */
  footer {
    padding: 24px 16px !important;
    font-size: 0.9rem !important;
    line-height: 1.6;
  }
  footer .related-links a {
    display: block;
    margin: 6px 0 !important;
    padding: 6px 0;
  }
}

/* ---- HOMEPAGE MOBILE POLISH ---- */
@media (max-width: 640px) {
  .hero-left {
    padding: 32px 20px !important;
  }
  .hero h1 {
    font-size: 30px !important;
    line-height: 1.2 !important;
  }
  .hero .subhead {
    font-size: 17px !important;
    line-height: 1.5 !important;
  }
  .hero-right {
    min-height: 200px !important;
  }
  .btn-cta {
    display: block !important;
    width: 100%;
    text-align: center;
    padding: 15px 20px !important;
    font-size: 1.05rem !important;
    min-height: 48px;
  }
  section {
    padding: 32px 16px !important;
  }
  .section-title {
    font-size: 22px !important;
    line-height: 1.3 !important;
  }
  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    font-size: 16px !important; /* prevents iOS zoom on focus */
    padding: 12px 14px !important;
  }
  .contact-form button {
    width: 100%;
    padding: 15px !important;
    font-size: 1.05rem !important;
    min-height: 48px;
  }
}

/* ---- EXTRA SMALL PHONES (< 400px) ---- */
@media (max-width: 400px) {
  .hero h1, .container h2 {
    font-size: 1.4rem !important;
  }
  .top-bar .phone {
    font-size: 0.95rem !important;
  }
  .floating-call {
    padding: 12px 18px !important;
    font-size: 14px !important;
  }
}

/* ---- BASE READABILITY IMPROVEMENTS (all mobile) ---- */
@media (max-width: 768px) {
  /* Prevent horizontal scroll from any overflow */
  html, body { overflow-x: hidden; max-width: 100%; }
  img, video, iframe {
    max-width: 100%;
    height: auto;
  }
  /* All links and buttons: minimum 44x44 tap target (WCAG AA) */
  a, button {
    min-height: 44px;
    display: inline-block;
  }
  /* Restore inline links inside prose */
  .container p a,
  .container li a,
  footer a,
  .top-bar a,
  .callstrip a {
    min-height: auto;
    display: inline;
  }
}
