
/* ================================================================
   MEKONG ORIGIN — COMPREHENSIVE MOBILE RESPONSIVE FIX
   Targets: mekongorigin.com (coffee) + produce.mekongorigin.com
   ================================================================ */

/* ── 1. GLOBAL OVERFLOW PREVENTION ─────────────────────────────── */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after {
  box-sizing: border-box;
}
img, video, iframe, table {
  max-width: 100%;
}

/* ── 2. HAMBURGER BUTTON — FULL DEFINITION ──────────────────────── */
/* Base: hidden by default on large screens */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background 0.2s ease;
  z-index: 1100;
  position: relative;
}
.hamburger:hover {
  background: rgba(26, 107, 60, 0.08);
}
/* The three bars */
.hamburger span,
.hamburger .hamburger-line {
  display: block;
  width: 24px;
  height: 2.5px;
  background: #1A6B3C !important;
  border-radius: 3px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
/* Animated X when active */
.hamburger.active span:nth-child(1),
.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.hamburger.active span:nth-child(2),
.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.active span:nth-child(3),
.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ── 3. NAV BAR MOBILE BREAKPOINT ───────────────────────────────── */
@media (max-width: 1023px) {
  .nav-links,
  .nav-actions,
  ul.nav-links {
    display: none !important;
  }
  .hamburger {
    display: flex !important;
  }
  /* Ensure navbar doesn't shrink logo into hamburger */
  .nav-inner,
  .navbar > div {
    padding: 0 1rem !important;
  }
  .navbar {
    padding: 0 1rem !important;
  }
  .nav-logo-img,
  .nav-brand img {
    height: 42px !important;
    width: auto !important;
  }
}

/* ── 4. MOBILE MENU DRAWER ──────────────────────────────────────── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: #145530 !important;
  border-bottom: 3px solid #C8A84B;
  padding: 1.25rem 1.5rem 2rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 1050;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-menu.open {
  display: flex !important;
}
.mobile-menu a,
.mobile-menu .nav-link {
  display: block !important;
  color: rgba(255,255,255,0.92) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  padding: 0.9rem 0.5rem !important;
  border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  text-decoration: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  white-space: nowrap;
}
.mobile-menu a:last-child,
.mobile-menu .nav-link:last-child {
  border-bottom: none !important;
}
.mobile-menu a:hover,
.mobile-menu .nav-link:hover,
.mobile-menu .nav-link.active {
  color: #C8A84B !important;
  background: transparent !important;
}
.mobile-menu .btn,
.mobile-menu .btn-primary,
.mobile-menu .btn-gold,
.mobile-menu .btn-samples-mobile {
  display: flex !important;
  width: 100% !important;
  justify-content: center !important;
  text-align: center !important;
  margin-top: 0.75rem !important;
  padding: 0.9rem 1rem !important;
  border-radius: 8px !important;
}
.mobile-section-head {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #C8A84B;
  padding: 1rem 0.5rem 0.4rem;
  margin-top: 0.5rem;
}

/* ── 5. CONTAINERS / PADDING ────────────────────────────────────── */
@media (max-width: 1023px) {
  .container {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
  .section-pad {
    padding: 64px 0 !important;
  }
}
@media (max-width: 767px) {
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .section-pad {
    padding: 48px 0 !important;
  }
  .section-title {
    font-size: clamp(1.6rem, 5vw, 2.2rem) !important;
  }
}
@media (max-width: 479px) {
  .container {
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
  }
  .section-pad {
    padding: 40px 0 !important;
  }
  .section-title {
    font-size: 1.55rem !important;
  }
}

/* ── 6. BUTTONS — PREVENT CLIPPING ─────────────────────────────── */
@media (max-width: 767px) {
  .btn,
  .btn-gold,
  .btn-primary,
  .btn-outline,
  .btn-outline-green,
  .btn-ghost,
  .btn-sm,
  .btn-lg,
  .prod-quote-btn,
  a[class*="btn"] {
    white-space: normal !important;
    word-break: break-word;
    text-align: center;
  }
  .hero-ctas,
  .cta-buttons,
  .founder-ctas {
    flex-direction: column !important;
    gap: 0.75rem !important;
    align-items: stretch !important;
  }
  .hero-ctas .btn,
  .cta-buttons .btn,
  .founder-ctas .btn,
  .hero-ctas a,
  .cta-buttons a {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* ── 7. PRODUCT GRIDS ───────────────────────────────────────────── */
@media (max-width: 1023px) {
  .products-grid,
  .blog-preview-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 767px) {
  .steps-grid,
  .why-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 479px) {
  .products-grid,
  .blog-preview-grid,
  .trust-badges-grid {
    grid-template-columns: 1fr !important;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .stat-item {
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  }
}

/* ── 8. HERO SECTION ────────────────────────────────────────────── */
@media (max-width: 767px) {
  .hero {
    min-height: 90vh !important;
  }
  .hero-headline {
    font-size: clamp(2rem, 7vw, 3.2rem) !important;
  }
  .hero-sub {
    font-size: 1rem !important;
  }
  .hero-scroll {
    display: none !important;
  }
}
@media (max-width: 479px) {
  .hero-headline {
    font-size: 1.9rem !important;
  }
}

/* ── 9. TABLES — PREVENT OVERFLOW ──────────────────────────────── */
.spec-table-wrap,
.fruit-spec-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
.spec-table {
  min-width: 280px;
}
@media (max-width: 767px) {
  .spec-table td {
    padding: 0.6rem 0.65rem !important;
    font-size: 0.84rem !important;
    vertical-align: top !important;
  }
  .spec-table td:first-child {
    white-space: nowrap !important;
    min-width: 100px !important;
    font-size: 0.82rem !important;
  }
}
@media (max-width: 479px) {
  .spec-table td:first-child {
    white-space: normal !important;
    min-width: 85px !important;
    font-size: 0.79rem !important;
  }
}

/* ── 10. COFFEE PRODUCTS PAGE ───────────────────────────────────── */
@media (max-width: 767px) {
  .prod-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .prod-section-header {
    padding: 1.4rem 1.25rem !important;
  }
  .prod-section-body {
    padding: 1.25rem !important;
  }
  .prod-section-title {
    font-size: 1.4rem !important;
  }
  .prod-subnav a {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.75rem !important;
  }
}

/* ── 11. PRODUCE FRUIT SPEC CARDS ───────────────────────────────── */
@media (max-width: 1023px) {
  .fruit-card-body {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 1.5rem !important;
  }
  .fruit-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.85rem !important;
    padding: 1.25rem 1.4rem !important;
  }
  .fruit-card-header .btn,
  .fruit-card-header a[class*="btn"] {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }
  .fruit-card-img {
    height: 240px !important;
  }
}
@media (max-width: 479px) {
  .fruit-card-body {
    padding: 1rem !important;
  }
  .fruit-card-img {
    height: 200px !important;
  }
  .fruit-card-header {
    padding: 1rem 1.1rem !important;
  }
  .fruit-card-title {
    font-size: 1.35rem !important;
  }
}

/* ── 12. PRODUCE NAVBAR (SEPARATE DROPDOWN SYSTEM) ─────────────── */
@media (max-width: 1023px) {
  .nav-dropdown-trigger {
    display: none !important;
  }
  .nav-cta,
  .navbar .btn-primary,
  .navbar .btn.nav-cta {
    display: none !important;
  }
}

/* ── 13. HERO PRODUCE ────────────────────────────────────────────── */
@media (max-width: 767px) {
  .page-hero-title {
    font-size: clamp(1.8rem, 6vw, 2.8rem) !important;
  }
  .page-hero-sub {
    font-size: 0.95rem !important;
  }
}

/* ── 14. FOOTER ──────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .footer {
    padding: 3rem 0 2rem !important;
  }
}

/* ── 15. FORMS — FULL WIDTH ON MOBILE ───────────────────────────── */
@media (max-width: 767px) {
  .form-row,
  .rfq-form-row {
    grid-template-columns: 1fr !important;
  }
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ── 16. NOTICE BAR ─────────────────────────────────────────────── */
@media (max-width: 767px) {
  .notice-bar {
    font-size: 0.78rem !important;
    padding: 0.55rem 1rem !important;
    text-align: center !important;
  }
}

/* ── 17. FLOATING BUTTONS ───────────────────────────────────────── */
.floating-quote-btn {
  max-width: calc(100vw - 2rem) !important;
}
@media (max-width: 479px) {
  .floating-quote-btn {
    font-size: 0.88rem !important;
    padding: 0.85rem 1.5rem !important;
    bottom: 80px !important;
  }
}

/* ── 18. ROUTE CARDS (PRODUCE HOMEPAGE) ─────────────────────────── */
@media (max-width: 767px) {
  .routes-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── 19. PROCESS STEPS ──────────────────────────────────────────── */
@media (max-width: 767px) {
  .timeline-item {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  .timeline-wrap::before {
    display: none !important;
  }
  .timeline-num {
    width: 52px !important;
    height: 52px !important;
  }
}

/* ── 20. FOUNDER GRID ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .founder-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .founder-img {
    max-width: 220px !important;
    margin: 0 auto !important;
    display: block !important;
  }
  .founder-img-wrap {
    margin-bottom: 1.5rem !important;
  }
}


/* ==========================================================================
   UNIVERSAL FORM RESPONSIVENESS & INPUT CUTOFF SHIELD
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box !important;
}

form, .form, .rfq-card, .contact-form, .quote-form {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

form input, form select, form textarea,
input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], input[type="date"], select, textarea {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  /* Collapse any inline 2-col or 3-col form grid rows into single column */
  form [style*="grid-template-columns"],
  .rfq-grid-2, .rfq-grid-3, .form-row-2, .form-row-3,
  .form-grid-2, .form-grid-3, .cat-form-row {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }
  form [style*="grid-column"],
  .rfq-field[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }
  .rfq-container {
    padding: 0 0.85rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  .rfq-card-body {
    padding: 1.25rem 1rem !important;
  }
}

@media (max-width: 480px) {
  .rfq-container {
    padding: 0 0.6rem !important;
  }
  .rfq-card-body {
    padding: 1rem 0.75rem !important;
  }
}
