/* ================================================================
   NextWeb OS — Global Responsive Fixes (v2)
   Covers: Navigation · Dropdowns · Hero · Stats · Cards · CRM ·
           Page heroes · Footer · Sub-pages · All breakpoints
   Compatible with: index, automation/, marketing/, industries/,
                    ai/, platform/, services/, about, contact…
================================================================ */

/* ── IMAGES ── */
img { max-width: 100%; height: auto; }


/* ================================================================
   GLOBAL OVERFLOW GUARD
================================================================ */
html { overflow-x: hidden !important; }
body { overflow-x: hidden !important; }

/* Prevent fixed-width elements from causing horizontal scroll */
table,
.pipeline-viz,
.chart-viz {
  max-width: 100%;
  overflow-x: auto;
}


/* ================================================================
   NAVIGATION — INLINE WIDTH OVERRIDE
   Sub-pages use inline style="width:860px" — clamp these on mobile
================================================================ */

/* Desktop: keep menus within viewport */
@media (min-width: 1025px) {
  .nav-dropdown-menu {
    max-width: min(95vw, 860px) !important;
    box-sizing: border-box !important;
  }

  /* Platform (leftmost) opens right-aligned */
  .nlinks > .nav-dropdown:nth-child(1) .nav-dropdown-menu {
    left: 0 !important;
    right: auto !important;
    transform: none !important;
    max-width: min(95vw, 860px) !important;
  }

  /* Industries (rightmost) opens left-aligned */
  .nlinks > .nav-dropdown:last-of-type .nav-dropdown-menu,
  .nlinks > .nav-dropdown:nth-child(6) .nav-dropdown-menu {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
  }

  /* Remaining menus centred */
  .nlinks > .nav-dropdown:not(:nth-child(1)):not(:nth-child(6)) .nav-dropdown-menu {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .nav-dropdown-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 0.8rem !important;
  }
}

/* Tablet + Mobile: override ALL inline widths */
@media (max-width: 1024px) {
  nav { padding: 0 2rem !important; }

  .nav-demo-desktop,
  .ndemo.nav-demo-desktop { display: none !important; }

  .hamburger { display: flex !important; }

  /* Full-screen mobile menu */
  .nlinks {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: #fff !important;
    flex-direction: column !important;
    padding: 8rem 2rem 2rem !important;
    gap: 0 !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    overflow-y: auto !important;
    display: none !important;
    z-index: 8999 !important;
    box-shadow: none !important;
  }
  .nlinks.open { display: flex !important; }

  .nlinks > a,
  .nav-dropdown > a,
  .nav-has-dropdown {
    font-size: 1.6rem !important;
    padding: 1.6rem 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    color: #1b2955 !important;
    text-decoration: none !important;
  }

  .nav-dropdown { display: block !important; width: 100% !important; }

  /* Neutralise ALL inline-style widths on dropdown menus */
  .nav-dropdown-menu,
  .nav-dropdown-menu[style] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    position: static !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    box-shadow: none !important;
    display: none !important;
  }

  .nav-dropdown-menu-inner {
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    min-width: 0 !important;
  }

  .nav-dropdown-grid {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.4rem !important;
  }

  .nav-dd-item { padding: 1rem 1.2rem !important; }

  /* Open state */
  .nav-dropdown.is-open .nav-dropdown-menu {
    display: block !important;
    background: #f9fafc !important;
    border-radius: 1rem !important;
    padding: 1rem !important;
    margin: 0.5rem 0 1rem !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Book Demo button in mobile menu */
  .nlinks::after {
    content: 'Book Free Demo →' !important;
    display: block !important;
    background: #e81f76 !important;
    color: #fff !important;
    text-align: center !important;
    padding: 1.6rem !important;
    border-radius: 0.8rem !important;
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    margin-top: 2rem !important;
    cursor: pointer !important;
  }
}


/* ================================================================
   ANNOUNCEMENT BAR
================================================================ */
@media (max-width: 768px) {
  .ann {
    font-size: 1.1rem !important;
    padding: 0.9rem 1.6rem !important;
    line-height: 1.5 !important;
  }
}


/* ================================================================
   HOMEPAGE HERO
================================================================ */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr !important;
    padding: 6rem 3rem 5rem !important;
    gap: 4rem !important;
    min-height: auto !important;
    text-align: center !important;
  }
  .htag { margin: 0 auto 2rem !important; }
  .hero-desc { margin: 0 auto 3rem !important; max-width: 100% !important; }
  .hbtns { justify-content: center !important; }
  .htrust { justify-content: center !important; }
  .hero-right { order: 2 !important; }
}

@media (max-width: 768px) {
  .hero { padding: 4rem 2rem 5rem !important; gap: 3rem !important; }
  .hero h1 { font-size: clamp(3rem, 9vw, 4.5rem) !important; letter-spacing: -0.03em !important; }
  .hero-desc { font-size: 1.5rem !important; }
  .hbtns { flex-direction: column !important; align-items: center !important; gap: 1.2rem !important; }
  .btn-p, .btn-o { width: 100% !important; justify-content: center !important; font-size: 1.5rem !important; padding: 1.5rem 2rem !important; }
  .hero-right { height: auto !important; }
  .hero-img { height: 28rem !important; border-radius: 1.4rem !important; }
  .hf1 { position: static !important; width: 100% !important; margin-top: 2rem !important; border-radius: 1.2rem !important; }
  .hf2 { display: none !important; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: clamp(2.8rem, 8.5vw, 3.5rem) !important; }
  .hero-img { height: 22rem !important; }
}


/* ================================================================
   HERO NOTIFICATION CARDS
================================================================ */
@media (max-width: 768px) {
  .hero-notifs {
    position: static !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    margin-top: 1.5rem !important;
    gap: 1rem !important;
    right: auto !important;
    top: auto !important;
  }
  .hero-notif { flex: 1 1 155px !important; max-width: 200px !important; min-width: 0 !important; }
}


/* ================================================================
   TRUST STRIP
================================================================ */
@media (max-width: 768px) {
  .tstrip { padding: 1.8rem 2rem !important; gap: 1.5rem !important; flex-wrap: wrap !important; justify-content: center !important; }
}
@media (max-width: 480px) {
  .tstrip { flex-direction: column !important; align-items: flex-start !important; gap: 1.2rem !important; }
}


/* ================================================================
   STATS ROW (Homepage)
================================================================ */
@media (max-width: 768px) {
  .stats-row { padding: 3.5rem 2rem !important; grid-template-columns: repeat(2, 1fr) !important; gap: 2rem !important; }
  .stat-n { font-size: 4rem !important; }
}
@media (max-width: 400px) {
  .stats-row { grid-template-columns: 1fr !important; }
}


/* ================================================================
   SECTION HEADINGS
================================================================ */
@media (max-width: 768px) {
  h2.sh { font-size: clamp(2.6rem, 7vw, 3.6rem) !important; }
  p.sd { font-size: 1.45rem !important; }
}
@media (max-width: 480px) {
  h2.sh { font-size: clamp(2.4rem, 7vw, 3rem) !important; }
}


/* ================================================================
   HOMEPAGE SECTION PADDING
================================================================ */
@media (max-width: 1024px) {
  .crm-section, .mkt-section, .analytics-section,
  .automation-section, .feat-img-sec, .ind-sec, .testi, .cta-sec {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }
}
@media (max-width: 768px) {
  .crm-section, .mkt-section, .analytics-section,
  .automation-section, .feat-img-sec, .ind-sec, .testi, .cta-sec {
    padding: 5rem 2rem !important;
  }
}


/* ================================================================
   CRM PIPELINE
================================================================ */
@media (max-width: 1024px) {
  .crm-inner { grid-template-columns: 1fr !important; gap: 4rem !important; }
}
@media (max-width: 768px) {
  .pipeline-viz { padding: 2rem 1.6rem !important; }
  .stages-head { gap: 0.3rem !important; }
  .sh-col { font-size: 0.75rem !important; padding: 0.35rem 0.15rem !important; }
  .stages-grid { gap: 0.3rem !important; }
  .deal-name { font-size: 0.85rem !important; }
  .deal-val { font-size: 0.78rem !important; }
  .deal-score { display: none !important; }
  .metrics-row { gap: 0.7rem !important; }
  .mbox .mv { font-size: 1.7rem !important; }
  .mbox .ml { font-size: 0.9rem !important; }
  .score-label { font-size: 0.95rem !important; min-width: 9rem !important; }
}
@media (max-width: 360px) {
  .stages-head, .pipeline-track { display: none !important; }
}


/* ================================================================
   MARKETING / ANALYTICS / AUTOMATION SECTIONS
================================================================ */
@media (max-width: 1024px) {
  .mkt-inner, .analytics-inner, .automation-inner {
    grid-template-columns: 1fr !important;
    gap: 4rem !important;
    text-align: center !important;
  }
}
@media (max-width: 768px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr) !important; gap: 0.8rem !important; }
  .kpi .kv { font-size: 2rem !important; }
  .orbit-wrap { width: 28rem !important; height: 28rem !important; }
  .orbit-center { width: 8rem !important; height: 8rem !important; }
  .orbit-center span { font-size: 1.1rem !important; }
  .ring1 { width: 17rem !important; height: 17rem !important; }
  .ring2 { width: 25rem !important; height: 25rem !important; }
  .onode { width: 6rem !important; height: 6rem !important; margin-top: -3rem !important; margin-left: -3rem !important; font-size: 0.95rem !important; }
}
@media (max-width: 480px) {
  .orbit-wrap { width: 24rem !important; height: 24rem !important; }
  .ring1 { width: 15rem !important; height: 15rem !important; }
  .ring2 { width: 22rem !important; height: 22rem !important; }
}


/* ================================================================
   PHOTO FEATURE
================================================================ */
@media (max-width: 1024px) {
  .fig { grid-template-columns: 1fr !important; gap: 3rem !important; }
}
@media (max-width: 768px) {
  .fimg { height: 26rem !important; }
}


/* ================================================================
   INDUSTRIES
================================================================ */
@media (max-width: 1024px) {
  .ind-layout { grid-template-columns: 1fr !important; gap: 2.5rem !important; }
}
@media (max-width: 768px) {
  .ind-tiles { grid-template-columns: repeat(2, 1fr) !important; gap: 1rem !important; }
  .ind-tile { padding: 1.6rem 1.4rem !important; }
  .ind-tile h3 { font-size: 1.35rem !important; }
  .ind-tile p { font-size: 1.05rem !important; }
  .ind-detail { position: static !important; top: auto !important; }
  .ind-detail h3 { font-size: 2.2rem !important; }
  .ind-stats { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 480px) {
  .ind-tiles { grid-template-columns: 1fr !important; }
}


/* ================================================================
   TESTIMONIALS
================================================================ */
@media (max-width: 768px) {
  .tgrid { grid-template-columns: 1fr !important; gap: 2rem !important; margin-top: 3rem !important; }
}


/* ================================================================
   CTA SECTION
================================================================ */
@media (max-width: 768px) {
  .cta-sec h2 { font-size: clamp(2.8rem, 7vw, 3.6rem) !important; }
  .cta-sec p { font-size: 1.5rem !important; }
  .cta-btns { flex-direction: column !important; align-items: center !important; gap: 1.2rem !important; }
  .cta-btns a { width: 100% !important; text-align: center !important; justify-content: center !important; font-size: 1.4rem !important; padding: 1.5rem 2rem !important; }
  .cta-meta { flex-direction: column !important; align-items: center !important; gap: 1.5rem !important; }
}


/* ================================================================
   FOOTER
================================================================ */
@media (max-width: 1024px) {
  footer { padding: 5rem 3rem 2.5rem !important; }
  .ft { grid-template-columns: 1fr 1fr 1fr !important; gap: 3rem !important; }
}
@media (max-width: 768px) {
  footer { padding: 4rem 2rem 2.5rem !important; }
  .ft { grid-template-columns: 1fr 1fr !important; gap: 2.5rem !important; }
  .ft > div:first-child { grid-column: 1 / -1 !important; }
  .fb-tag { max-width: 100% !important; }
  .fb-bot { flex-direction: column !important; align-items: flex-start !important; gap: 1.2rem !important; }
}
@media (max-width: 360px) {
  .ft { grid-template-columns: 1fr !important; }
}


/* ================================================================
   SUB-PAGE HEROES (.page-hero)
================================================================ */
@media (max-width: 1024px) {
  .page-hero { padding: 8rem 3rem 7rem !important; }
}
@media (max-width: 768px) {
  .page-hero { padding: 7rem 2rem 6rem !important; }
  .page-hero h1 { font-size: clamp(3rem, 8vw, 5rem) !important; }
  .page-hero p { font-size: 1.6rem !important; }
  .breadcrumb { padding: 1.2rem 2rem !important; }
}


/* ================================================================
   STATS STRIP (inside sub-page heroes)
================================================================ */
.stats-strip {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
}
.stat-box {
  min-width: 230px !important;
  flex: 1 1 130px !important;
  max-width: 215px !important;
  box-sizing: border-box !important;
}
@media (max-width: 480px) {
  .stat-box {
    flex: 1 1 calc(50% - 0.5rem) !important;
    max-width: calc(50% - 0.5rem) !important;
    padding: 1.8rem 1.5rem !important;
  }
  .stat-box-n { font-size: 3rem !important; }
}


/* ================================================================
   SUB-PAGE CONTENT SECTIONS (.sec, .cta-sec)
================================================================ */
@media (max-width: 1024px) {
  .sec { padding: 7rem 3rem !important; }
}
@media (max-width: 768px) {
  .sec { padding: 6rem 2rem !important; }
  .cta-sec { padding: 6rem 2rem !important; }
}


/* ================================================================
   CARD GRIDS (sub-pages)
================================================================ */
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap: 2rem !important;
  }
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr !important; }
}


/* ================================================================
   WHY / RESULTS LAYOUT (sub-pages)
================================================================ */
@media (max-width: 1024px) {
  .why-layout {
    grid-template-columns: 1fr !important;
    gap: 4rem !important;
    text-align: center !important;
  }
  .results-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
  .results-grid { grid-template-columns: 1fr !important; }
}


/* ================================================================
   BREADCRUMB
================================================================ */
.breadcrumb {
  white-space: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
}
.breadcrumb::-webkit-scrollbar { display: none; }


/* ================================================================
   PLATFORM NAV (horizontal scroll tabs)
================================================================ */
.platform-nav {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  padding: 0 2rem !important;
}
.platform-nav::-webkit-scrollbar { display: none; }


/* ================================================================
   TOAST NOTIFICATIONS
================================================================ */
@media (max-width: 768px) {
  #nw-toasts { width: calc(100vw - 3.2rem) !important; right: 1.6rem !important; bottom: 1.6rem !important; }
  .nw-toast { font-size: 1.1rem !important; }
}


/* ================================================================
   MISC UTILITY
================================================================ */
#nav-login-btn { }
@media (max-width: 768px) {
  #nav-login-btn { display: none !important; }
}

.card, .result-card, .tcard { height: auto !important; min-height: 0 !important; }
#preloader { z-index: 10000 !important; }


/* ================================================================
   TWO-COLUMN INLINE GRIDS — Mobile Stack Fix
   Applied via class="two-col-grid" replacing inline style grids
   across ai/, automation/, marketing/, platform/, industries/ pages
================================================================ */

/* Desktop layout */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}
.two-col-grid--wide {
  gap: 8rem;
  align-items: center;
}
.two-col-grid--md {
  gap: 5rem;
  align-items: center;
}
.two-col-grid--tight {
  gap: 1.5rem;
  align-items: start;
}

/* Stack to single column on tablet and below */
@media (max-width: 1024px) {
  .two-col-grid,
  .two-col-grid--wide,
  .two-col-grid--md,
  .two-col-grid--tight {
    grid-template-columns: 1fr !important;
    gap: 4rem !important;
  }
  .two-col-grid--tight {
    gap: 2rem !important;
  }
}

@media (max-width: 768px) {
  .two-col-grid,
  .two-col-grid--wide,
  .two-col-grid--md {
    gap: 3rem !important;
  }
}


/* ================================================================
   TAB PANELS — 2-col inline CSS in <style> blocks
================================================================ */
@media (max-width: 1024px) {
  .tab-panel.active {
    grid-template-columns: 1fr !important;
    gap: 3rem !important;
  }
}


/* ================================================================
   AI PAGES — Page-specific fixes
================================================================ */

/* ── Compare Table — horizontal scroll on mobile ── */
.compare-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .compare-table {
    font-size: 1.2rem !important;
  }
  .compare-table td,
  .compare-table th {
    padding: 1.2rem 1.5rem !important;
    white-space: normal !important;
  }
}

@media (max-width: 480px) {
  .compare-table td,
  .compare-table th {
    padding: 1rem 1.2rem !important;
    font-size: 1.1rem !important;
  }
}

/* ── Process Steps — prevent connector line overflow on mobile ── */
@media (max-width: 768px) {
  .process-steps {
    grid-template-columns: 1fr !important;
    gap: 3rem !important;
  }
  .process-steps::before { display: none !important; }
  .process-step { padding: 0 !important; text-align: left !important; }
  .ps-num { margin-bottom: 1rem !important; }
}

/* ── Tab Buttons — wrap on mobile ── */
@media (max-width: 768px) {
  .tab-btns { gap: 0.8rem !important; }
  .tab-btn {
    padding: 0.8rem 1.8rem !important;
    font-size: 1.3rem !important;
  }
}

/* ── Tab Panels — stack at 1024px (inline only covers 768px) ── */
@media (max-width: 1024px) {
  .tab-panel.active {
    grid-template-columns: 1fr !important;
    gap: 3rem !important;
  }
}

/* ── AI Sub-nav (horizontal scroll bar) ── */
.ai-nav {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
}
.ai-nav::-webkit-scrollbar { display: none; }

@media (max-width: 768px) {
  .ai-nav { padding: 0 2rem !important; }
  .an-link { padding: 1.2rem 1.6rem !important; font-size: 1.25rem !important; }
}

/* ── Testimonial grid on AI pages ── */
@media (max-width: 768px) {
  .testi-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

/* ── Related cards grid ── */
@media (max-width: 480px) {
  .related-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Integration badges — wrap cleanly ── */
.int-grid {
  flex-wrap: wrap !important;
}
@media (max-width: 480px) {
  .int-badge {
    padding: 1.2rem 2rem !important;
    font-size: 1.3rem !important;
  }
}
