/* ============================================================
   FARMSPHERICA — mobile.css
   Paste this AFTER style.css on every page.
   Fixes horizontal overflow, hamburger, and all mobile layouts.
   ============================================================ */

/* ── Global overflow fix ── */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

*, *::before, *::after {
  max-width: 100%;
}

/* ── Container never overflows ── */
.container {
  padding: 0 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

/* ════════════════════════════════
   HEADER / NAV
════════════════════════════════ */
@media (max-width: 900px) {

  .nav-inner {
    padding: 0 1.25rem;
    gap: 0.5rem;
  }

  /* Hide desktop nav links and buttons */
  .nav-links,
  .nav-login-btn,
  .nav-signup-btn {
    display: none !important;
  }

  /* Show hamburger */
  .nav-hamburger {
    display: flex !important;
  }

  /* Keep user pill but shrink it */
  .nav-user-pill {
    display: flex !important;
    padding: 0.25rem 0.6rem 0.25rem 0.25rem;
  }

  .nav-user-name {
    display: none;
  }

  .nav-chevron {
    display: none;
  }

  /* Dropdown anchors to right edge on mobile */
  .nav-user-dropdown {
    right: -1rem;
    min-width: 200px;
  }
}

/* ── Mobile nav menu ── */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1.5px solid rgba(46, 125, 50, 0.25);
  padding: 0.75rem 1.25rem 1rem;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  /* Slide down animation */
  transform-origin: top;
  animation: none;
}

.nav-mobile.open {
  display: flex;
  animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-mobile a {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: block;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-mobile-divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0;
}

.nav-mobile-login {
  color: var(--accent) !important;
  font-weight: 600 !important;
  border: 1.5px solid rgba(46,125,50,0.25);
  text-align: center;
  margin-top: 0.25rem;
}

/* ════════════════════════════════
   HERO SECTION
════════════════════════════════ */
@media (max-width: 900px) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-h) + 2rem);
    padding-bottom: 3rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-visual {
    order: -1;
  }

  .hero-card-wrap {
    max-width: 100%;
  }

  .float-badge {
    display: none;
  }

  .hero-content {
    text-align: center;
    align-items: center;
  }

  .hero-eyebrow {
    justify-content: center;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .hero-stats {
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: space-around;
  }

  .hero-mini-stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
}

/* ════════════════════════════════
   ABOUT SECTION
════════════════════════════════ */
@media (max-width: 900px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-content {
    text-align: center;
    align-items: center;
  }

  .about-points {
    text-align: left;
  }

  .stat-chips {
    justify-content: center;
  }
}

/* ════════════════════════════════
   HOW IT WORKS
════════════════════════════════ */
@media (max-width: 900px) {
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .steps-grid::before {
    display: none;
  }

  .step-card {
    padding: 1.5rem;
  }
}

/* ════════════════════════════════
   BENEFITS
════════════════════════════════ */
@media (max-width: 900px) {
  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .benefit-card.featured {
    grid-column: span 1;
  }

  .benefit-card {
    padding: 1.25rem;
  }
}

/* ════════════════════════════════
   TESTIMONIALS
════════════════════════════════ */
@media (max-width: 900px) {
  .testimonials-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

@media (max-width: 600px) {
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════
   CTA BAND
════════════════════════════════ */
@media (max-width: 700px) {
  .cta-band {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
  }

  .btn-cta-white {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ════════════════════════════════
   FOOTER
════════════════════════════════ */
@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-brand {
    grid-column: span 1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
  }
}

/* ════════════════════════════════
   CROPS PAGE
════════════════════════════════ */
@media (max-width: 900px) {
  .crops-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar { display: none; }

  .crops-search-wrap {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .crops-grid {
    grid-template-columns: 1fr;
  }

  .crop-card-img {
    height: 110px;
  }
}

/* ════════════════════════════════
   LOGIN PAGE
════════════════════════════════ */
@media (max-width: 900px) {
  .login-main {
    grid-template-columns: 1fr;
  }

  .login-left {
    display: none;
  }

  .login-right {
    min-height: calc(100vh - var(--nav-h));
    padding: 2rem 1.25rem;
    align-items: flex-start;
  }

  .login-form-wrap {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .social-logins {
    flex-direction: column;
  }

  .auth-tabs {
    margin-bottom: 1.25rem;
  }
}

/* ════════════════════════════════
   PAGE HERO (inner pages)
════════════════════════════════ */
@media (max-width: 600px) {
  .page-hero {
    padding-top: calc(var(--nav-h) + 1.5rem);
    padding-bottom: 2rem;
  }

  .page-hero-inner {
    gap: 0.75rem;
  }
}

/* ════════════════════════════════
   GENERAL SECTION SPACING
════════════════════════════════ */
@media (max-width: 900px) {
  section {
    padding: 4rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
  }
}

@media (max-width: 600px) {
  section {
    padding: 3rem 0;
  }

  .display-xl {
    font-size: clamp(2.2rem, 8vw, 3.2rem);
  }

  .display-lg {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
  }

  .display-md {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  .body-lg {
    font-size: 1rem;
  }
}

/* ════════════════════════════════
   GLASS CARDS ON SMALL SCREENS
════════════════════════════════ */
@media (max-width: 600px) {
  .glass-card {
    border-radius: 16px;
  }

  .hero-glass-card {
    border-radius: 20px;
    padding: 1.25rem;
  }

  .step-card,
  .benefit-card,
  .testimonial-card {
    border-radius: 16px;
  }
}

/* ════════════════════════════════
   PREVENT TEXT OVERFLOW
════════════════════════════════ */
h1, h2, h3, h4, p {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ════════════════════════════════
   TOUCH TARGETS
════════════════════════════════ */
@media (max-width: 900px) {
  .btn,
  .filter-tab,
  .nav-mobile a,
  .social-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .theme-toggle {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Override the pseudo element centering */
  .theme-toggle::after {
    top: 50%;
    transform: translateY(-50%);
    left: 3px;
  }

  [data-theme="dark"] .theme-toggle::after {
    transform: translateY(-50%) translateX(18px);
  }
}