/*
 * Bell & Lyons Insurance — Mobile Stylesheet
 * Handles all responsive/mobile overrides.
 * Link this AFTER site.css in every HTML file:
 *   <link rel="stylesheet" href="assets/styles/mobile.css" />
 */

/* ─── Hamburger Button ─────────────────────────────────────── */

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  transition: background 180ms ease;
  flex-shrink: 0;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(33, 99, 209, 0.07);
  outline: none;
}

.nav-toggle-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.nav-toggle-bars span {
  display: block;
  width: 22px;
  height: 2px;
  background: #102542;
  border-radius: 2px;
  transition: transform 260ms ease, opacity 200ms ease, width 200ms ease;
  transform-origin: center;
}

/* Animated X when open */
.nav-toggle.is-open .nav-toggle-bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open .nav-toggle-bars span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nav-toggle.is-open .nav-toggle-bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Mobile Nav Drawer ────────────────────────────────────── */
/* Note: .nav-drawer display, positioning, and open/close animation
   are handled entirely by site.css @media (max-width: 900px) via
   the body.nav-drawer-open mechanism in site-v13.js mountMobileNav().
   The legacy .nav-drawer { display:none; opacity:0 } block that was
   here conflicted with that mechanism and has been removed. */

.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 18px;
  border-bottom: 1px solid rgba(16, 37, 66, 0.08);
  margin-bottom: 0;
}

.nav-drawer-logo {
  width: 110px;
  height: auto;
}

.nav-drawer-close {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(16, 37, 66, 0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #102542;
  font-size: 1.2rem;
  transition: background 160ms ease;
}

.nav-drawer-close:hover {
  background: rgba(16, 37, 66, 0.12);
}

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0;
}

.nav-drawer-links a {
  display: flex;
  align-items: center;
  padding: 11px 0;
  color: #102542;
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 0;
  transition: background 160ms ease, color 160ms ease;
}

.nav-drawer-links a:hover,
.nav-drawer-links a:focus-visible {
  background: rgba(33, 99, 209, 0.05);
  color: #2163d1;
}

.nav-drawer-links a.is-active {
  color: #2163d1;
  background: rgba(33, 99, 209, 0.06);
}

.nav-drawer-footer {
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-drawer-body {
  display: grid;
  gap: 28px;
}

.nav-drawer-section {
  display: grid;
  gap: 14px;
}

.nav-drawer-label {
  color: #b98a2a;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: #2163d1;
  color: #ffffff !important;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-align: center;
  transition: background 160ms ease, transform 160ms ease;
  box-shadow: 0 2px 8px rgba(33, 99, 209, 0.18);
}

.nav-drawer-cta:hover {
  background: #ffffff;
  color: #2163d1 !important;
  border: 1px solid #2163d1;
  transform: translateY(-1px);
}

.nav-drawer-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  color: #2163d1 !important;
  border: 1.5px solid rgba(33, 99, 209, 0.3);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  text-align: center;
  transition: background 160ms ease;
}

.nav-drawer-phone:hover {
  background: rgba(33, 99, 209, 0.05);
}

/* ─── Tablet (≤1024px) ─────────────────────────────────────── */

@media (max-width: 1024px) {
  .nav-top {
    width: 100%;
  }

  .nav {
    flex-wrap: wrap;
    gap: 0;
    padding: 12px 20px;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 0.88rem;
  }
}

/* ─── Mobile (≤768px) ──────────────────────────────────────── */

@media (max-width: 768px) {

  /* Nav: show hamburger, hide desktop links */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    z-index: 1;
  }

  .nav-links {
    display: none !important;
  }

  .nav-meta {
    display: none !important;
  }

  /* 3-column grid so logo is perfectly centered */
  .nav-top {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    width: 100%;
  }

  .brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  .nav {
    padding: 8px 16px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
  }

  /* Tighter header so chatbot gets more screen real estate */
  .topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: #fff !important;
    box-shadow: 0 1px 0 rgba(16, 37, 66, 0.08) !important;
  }

  .brand-logo {
    width: 90px !important;
    height: auto !important;
    display: block !important;
  }

  /* site.css @media (max-width: 900px) handles .nav-drawer display:grid */

  /* ─── Drawer — minimal, logo-free ─────────────── */

  .nav-drawer-logo {
    display: none !important;
  }

  .nav-drawer-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 0 16px !important;
    border-bottom: 1px solid rgba(16, 37, 66, 0.08) !important;
    margin-bottom: 0 !important;
  }

  .nav-drawer-menu-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8a96aa;
  }

  .nav-drawer-phone svg {
    flex-shrink: 0;
  }

  /* ─── Hero / Chat Section ──────────────────── */

  .chatbot-hero,
  .chatbot-hero-home {
    padding: 40px 0 28px !important;
  }

  .chatbot-shell,
  .chatbot-shell-home {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .chatbot-copy,
  .chatbot-copy-home {
    padding: 24px 16px !important;
    text-align: left !important;
    border-radius: 24px !important;
  }

  .chatbot-copy-home h1,
  .chatbot-copy h1 {
    font-size: clamp(2rem, 8vw, 2.8rem) !important;
    max-width: none !important;
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .chatbot-copy-home .chatbot-concept-subtitle,
  .chatbot-copy p {
    font-size: 1rem !important;
    max-width: none !important;
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .hero-actions,
  .chatbot-copy-home .hero-actions,
  .chatbot-copy-home .language-strip,
  .chatbot-copy-home .trust-strip {
    justify-content: flex-start !important;
  }

  .chatbot-panel {
    padding: 20px 16px !important;
    border-radius: 24px !important;
  }

  /* ─── Leo Chat — Chatbot-First Mobile ──────── */

  /* Zero-gap: chat appears immediately after header */
  .top-leo-chat-section {
    padding: 0 0 0 !important;
    margin-top: 0 !important;
  }

  .top-leo-chat-shell {
    padding: 0 !important;
    gap: 0 !important;
  }

  /* Card wrapper: no decoration, full bleed */
  .assistant-card-wide {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  /* Copy block: HIDDEN on mobile — chatbot is the CTA */
  .assistant-copy.top-leo-chat-copy {
    display: none !important;
  }

  /* Chat panel: full-width, fills viewport height */
  .assistant-panel.top-leo-chat-panel {
    width: 100% !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: calc(100dvh - 56px) !important;
    max-height: calc(100dvh - 56px) !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  /* Leo header bar — centered */
  .chatbot-panel-head {
    padding: 14px 18px !important;
    border-bottom: 1px solid rgba(16, 37, 66, 0.07) !important;
    flex-shrink: 0 !important;
    background: #fff !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .chatbot-presence {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    text-align: center !important;
  }

  .home-chat-avatar-wrap {
    flex-shrink: 0 !important;
    margin: 0 auto 2px !important;
  }

  .home-chat-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }

  .home-chat-online-dot {
    width: 9px !important;
    height: 9px !important;
    bottom: 1px !important;
    right: 1px !important;
  }

  .chatbot-presence strong {
    font-size: 0.97rem !important;
    font-weight: 700 !important;
  }

  .chatbot-presence p {
    font-size: 0.78rem !important;
    margin: 0 !important;
    color: #3a9e5f !important;
  }

  /* Scrollable message log */
  .assistant-log {
    flex: 1 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 16px 16px 8px !important;
    gap: 10px !important;
    scroll-behavior: smooth !important;
  }

  .assistant-log-chatbot {
    flex: 1 !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  /* Chat bubbles */
  .bubble {
    font-size: 0.95rem !important;
    padding: 11px 15px !important;
    border-radius: 18px !important;
    line-height: 1.55 !important;
    max-width: 88% !important;
  }

  .bubble.leo {
    border-radius: 4px 18px 18px 18px !important;
  }

  .bubble.user {
    border-radius: 18px 4px 18px 18px !important;
  }

  /* Quick-reply choice buttons */
  .choice-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 0 16px 10px !important;
    flex-shrink: 0 !important;
  }

  .choice-grid button {
    width: 100% !important;
    padding: 13px 18px !important;
    font-size: 0.9rem !important;
    min-height: 48px !important;
    border-radius: 14px !important;
    text-align: left !important;
    line-height: 1.35 !important;
    touch-action: manipulation !important;
  }

  /* Input bar — pinned to bottom of panel */
  .assistant-input {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 14px 14px !important;
    border-top: 1px solid rgba(16, 37, 66, 0.07) !important;
    background: #fff !important;
    flex-shrink: 0 !important;
    margin-top: auto !important;
  }

  .assistant-input input {
    flex: 1 !important;
    min-height: 48px !important;
    height: 48px !important;
    font-size: 16px !important;
    border-radius: 999px !important;
    padding: 12px 18px !important;
    border: 1.5px solid rgba(16, 37, 66, 0.14) !important;
    background: #f8f9fb !important;
    caret-color: #2163d1 !important;
  }

  .assistant-input input:focus {
    border-color: #2163d1 !important;
    background: #fff !important;
    outline: none !important;
  }

  .assistant-input button[data-assistant-send] {
    flex: 0 0 48px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    color: transparent !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #25D366 !important;
    touch-action: manipulation !important;
    position: relative !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(37, 211, 102, 0.35) !important;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease !important;
  }

  .assistant-input button[data-assistant-send]:hover,
  .assistant-input button[data-assistant-send]:active {
    background: #1ebe5d !important;
    transform: scale(1.06) !important;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45) !important;
  }

  /* WhatsApp-style paper plane icon via pseudo-element, no text */
  .assistant-input button[data-assistant-send]::before {
    content: none !important;
  }

  .assistant-input button[data-assistant-send]::after {
    content: "" !important;
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/%3E%3C/svg%3E") center/contain no-repeat !important;
  }

  /* Status/summary notes */
  .mini-note {
    padding: 0 16px 4px !important;
    font-size: 0.78rem !important;
    flex-shrink: 0 !important;
  }

  /* General assistant cards on other pages */
  .assistant-card {
    padding: 20px 16px !important;
    border-radius: 24px !important;
  }

  .assistant-copy {
    text-align: left !important;
  }

  .assistant-copy h2 {
    font-size: clamp(1.6rem, 6vw, 2.2rem) !important;
    max-width: none !important;
  }

  /* ─── Process Section (below chatbot) ─────── */

  /* Hide phone image on mobile — clean text-only steps */
  .auto-process-visual {
    display: none !important;
  }

  .auto-process-layout {
    display: block !important;
    padding: 0 !important;
  }

  .auto-process-copy {
    padding: 28px 20px !important;
  }

  .auto-process-section {
    padding: 32px 0 !important;
  }

  .auto-process-section > .container {
    padding: 0 !important;
  }

  .auto-process-step {
    padding: 14px 0 !important;
    border-bottom: 1px solid rgba(16, 37, 66, 0.07) !important;
  }

  .auto-process-step:last-of-type {
    border-bottom: none !important;
  }

  .auto-process-cta {
    margin-top: 20px !important;
    padding: 0 !important;
  }

  /* ─── Coverage Explainer ─────────────────────── */

  .coverage-explainer-section {
    padding: 28px 0 !important;
    overflow: hidden !important;
  }

  .coverage-explainer {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* ─── Compare Showcase Section ─────────────── */

  .compare-showcase {
    padding: 36px 0 !important;
  }

  .compare-showcase-layout {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .compare-showcase-visual {
    display: none !important; /* hide decorative image on mobile */
  }

  .compare-showcase-head h2 {
    font-size: clamp(1.6rem, 6vw, 2.2rem) !important;
  }

  .compare-step {
    padding: 14px 0 !important;
  }

  /* ─── Article Grid ──────────────────────────── */

  .auto-article-section {
    padding: 28px 12px !important;
  }

  .auto-article-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
  }

  .auto-article-card {
    border-radius: 16px !important;
  }

  .auto-article-copy h3 {
    font-size: 0.88rem !important;
    line-height: 1.4 !important;
  }

  /* ─── Hero (other pages) ───────────────────── */

  .hero,
  .chatbot-hero {
    padding: 36px 0 24px !important;
  }

  .hero-shell,
  .hero-grid,
  .page-hero {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .hero-copy h1,
  .page-hero h1 {
    font-size: clamp(2rem, 8vw, 3rem) !important;
    max-width: none !important;
  }

  .hero-copy-premium {
    min-height: auto !important;
    padding-top: 16px !important;
  }

  .visual-card {
    min-height: 320px !important;
  }

  /* ─── Coverage Cards ────────────────────────── */

  .coverage-cards,
  .detail-grid,
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .coverage-card,
  .detail-card,
  .doc-card {
    padding: 20px 18px !important;
    border-radius: 20px !important;
  }

  /* ─── Section Heads ─────────────────────────── */

  .section-head h2,
  .compare-showcase-head h2,
  .auto-article-head h2 {
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
    text-align: left !important;
  }

  .section-head p {
    text-align: left !important;
  }

  /* ─── Contact / Form Pages ──────────────────── */

  .contact-shell,
  .form-shell {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .contact-card,
  .form-card {
    padding: 24px 18px !important;
    border-radius: 20px !important;
  }

  /* ─── Buttons ────────────────────────────────── */

  .button,
  .nav-cta {
    min-height: 48px !important;
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
  }

  /* ─── General spacing ────────────────────────── */

  .container {
    padding: 0 14px !important;
  }

  section {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* ─── Small phones (≤390px) ───────────────────────────────── */

@media (max-width: 390px) {
  .auto-article-grid {
    grid-template-columns: 1fr !important;
  }

  .chatbot-copy-home h1,
  .chatbot-copy h1 {
    font-size: 1.9rem !important;
  }

  .assistant-copy.top-leo-chat-copy h2 {
    font-size: 1.3rem !important;
  }

  .assistant-copy h2 {
    font-size: 1.5rem !important;
  }

  .assistant-panel.top-leo-chat-panel {
    min-height: 460px !important;
    max-height: 80dvh !important;
  }

  .choice-grid button {
    font-size: 0.85rem !important;
    padding: 11px 14px !important;
  }

  .bubble {
    font-size: 0.9rem !important;
    max-width: 94% !important;
  }
}
