/* ═══════════════════════════════════════════════════════════════
   AGRI GROWTH ENGINE X — MOBILE DOMINATION
   ═══════════════════════════════════════════════════════════════ */

/* ── Mobile sticky search bar (sits below the nav) ──────────── */
.agex-mobile-search-bar {
  display: none; /* hidden on desktop */
}

@media (max-width: 782px) {
  /* Show our bar, hide theme's toggles */
  .search-toggle,
  .header-search-toggle,
  .nav-search-btn,
  button[class*="search-toggle"],
  a[class*="search-toggle"] {
    display: none !important;
  }

  .agex-mobile-search-bar {
    display: block;
    position: sticky;
    top: 0;
    z-index: var(--agex-z-sticky);
    background: rgba(250,255,252,.96);
    border-bottom: 1px solid rgba(0,147,69,.14);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    padding: 10px 12px;
    box-shadow: 0 4px 20px rgba(0,40,20,.09);
  }

  .agex-msb-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 2px solid rgba(0,147,69,.25);
    border-radius: var(--agex-r-pill);
    padding: 0 14px;
    transition: border-color var(--agex-dur) ease, box-shadow var(--agex-dur) ease;
  }
  .agex-msb-inner:focus-within {
    border-color: var(--agex-green);
    box-shadow: 0 0 0 4px rgba(0,196,106,.15);
  }
  .agex-msb-inner svg {
    color: var(--agex-muted);
    flex-shrink: 0;
  }
  #agex-msb-input {
    flex: 1;
    height: 48px;
    border: none;
    outline: none;
    font-family: var(--agex-font-body);
    font-size: 16px; /* 16px avoids iOS zoom */
    color: var(--agex-ink);
    background: transparent;
  }
  #agex-msb-input::placeholder { color: var(--agex-muted); }
  #agex-msb-submit {
    padding: 8px 16px;
    border: none;
    border-radius: var(--agex-r-pill);
    background: var(--agex-green);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--agex-dur) ease;
  }
  #agex-msb-submit:hover { background: var(--agex-green-mid); }

  /* ── FAB: slightly smaller on mobile ─────────────────────── */
  .agex-fab {
    bottom: 16px; right: 14px;
    padding: 12px 18px;
    font-size: 14px;
  }
  .agex-fab-label { display: none; } /* icon-only on very small */

  /* ── Assistant panel full-height on mobile ───────────────── */
  .agex-assistant-panel {
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
  }

  /* ── Cards: single column ────────────────────────────────── */
  .agex-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* ── Hero adjustments ────────────────────────────────────── */
  .agex-hero {
    min-height: 260px;
    border-radius: var(--agex-r);
    padding: 20px 18px;
  }
  .agex-hero__ctas { gap: 8px; }
  .agex-btn { padding: 11px 18px; font-size: 14px; }

  /* ── Reading experience ──────────────────────────────────── */
  body.agex-active.agex-single .entry-content {
    font-size: 17px;
    max-width: 100%;
  }

  /* ── Thumb-safe tap targets ──────────────────────────────── */
  .agex-chip {
    padding: 10px 16px;
    font-size: 13px;
  }

  /* ── Body bottom padding so FAB doesn't overlap content ──── */
  body.agex-active { padding-bottom: 80px; }

  /* ── Hide cluttered theme nav elements on mobile ─────────── */
  .main-navigation .menu > li > .sub-menu { display: none !important; }

  /* ── Image in single post: full bleed ────────────────────── */
  body.agex-active.agex-single .entry-content img {
    border-radius: var(--agex-r-sm);
  }
}

@media (max-width: 480px) {
  /* Ultra-small: hide fab label on xs */
  .agex-fab-label { display: none; }
  .agex-fab { padding: 14px; border-radius: 50%; }
  .agex-fab-icon { margin: 0; }
}

@media (min-width: 783px) {
  /* Desktop: hide mobile search bar */
  .agex-mobile-search-bar { display: none !important; }

  /* FAB label visible on desktop */
  .agex-fab-label { display: inline; }

  /* Desktop assistant: centred sheet */
  .agex-assistant-panel {
    max-width: 600px;
    margin: 0 auto 0;
    border-radius: var(--agex-r-lg) var(--agex-r-lg) 0 0;
  }
}
