/* ============================================
   NEXAVO AGENCY - FULLY FIXED RESPONSIVE CSS
   ============================================ */

/* ---------- GLOBAL FIXES ---------- */
html {
  width: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden !important;
  width: 100%;
}

/* Remove overflow-x from container — it creates inner scroll contexts */
.container {
  width: 100%;
  max-width: 1400px;
}

/* Canvas fix - prevents Three.js from creating horizontal overflow */
canvas {
  display: block;
  max-width: 100%;
}

/* Prevent sections from overflowing */
section {
  overflow-x: clip;
}

/* ---------- MOBILE STYLES (up to 768px) ---------- */
@media (max-width: 768px) {
  body {
    overflow-x: hidden !important;
    cursor: auto;
  }

  /* ---------- NAVIGATION ---------- */
  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    transform: translateX(-100%);
    width: 100%;
    height: calc(100dvh - 70px);
    background: rgba(20, 20, 30, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: transform 0.3s ease, visibility 0.3s;
    backdrop-filter: blur(20px);
    z-index: 999;
    pointer-events: none;
    visibility: hidden;
  }

  .nav-menu.active {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .btn-glow {
    padding: 8px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .btn-glow span {
    display: none;
  }

  .menu-toggle {
    margin-left: auto;
    flex-shrink: 0;
    z-index: 1001;
  }

  /* ---------- HERO SECTION ---------- */
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .hero-title {
    font-size: 2.5rem;
    white-space: normal !important;
    word-break: break-word;
  }

  .hero-desc {
    max-width: 560px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    white-space: normal !important;
    word-break: break-word;
  }

  .hero-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-stats {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .hero-visual {
    height: 300px;
  }

  .floating-card {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
  .floating-card i {
    font-size: 1rem;
  }

  /* ---------- SECTION TITLES ---------- */
  .section-title {
    font-size: 2rem;
    white-space: normal !important;
    word-break: break-word;
  }
  .header-content p {
    white-space: normal !important;
    word-break: break-word;
  }

  /* ---------- SERVICES & PARTNERS GRIDS ---------- */
  .services-grid,
  .services-grid-detailed {
    grid-template-columns: 1fr;
  }

  .partners-grid {
    grid-template-columns: 1fr;
  }

  /* ---------- PORTFOLIO ---------- */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-filter-bar {
    flex-direction: column;
    align-items: stretch;
    border-radius: 30px;
    padding: 1.2rem;
  }

  .filter-buttons {
    justify-content: center;
  }

  #searchProjects {
    width: 100%;
  }

  /* ---------- STORY SECTION (About Page) ---------- */
  .story-grid {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr !important;
    gap: 2rem;
    width: 100%;
    max-width: 100%;
  }

  .story-content {
    width: 100% !important;
    overflow: visible !important;
    word-break: break-word;
    padding: 0;
  }

  .story-content h2 {
    font-size: 1.8rem;
    white-space: normal !important;
  }

  .story-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: normal !important;
    word-wrap: break-word;
  }

  .story-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1rem;
  }

  .story-stats div {
    flex: 0 0 auto;
    min-width: 80px;
  }

  .story-image {
    width: 100% !important;
    max-width: 100%;
    overflow: hidden;
    border-radius: 20px;
  }

  .story-image img {
    width: 100%;
    height: auto;
  }

  /* ---------- PRICING SECTION ---------- */
  .pricing-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  /* ---------- VALUES GRID ---------- */
  .values-grid {
    grid-template-columns: 1fr;
  }

  /* ---------- PROCESS STEPS ---------- */
  .process-steps {
    grid-template-columns: 1fr;
  }

  /* ---------- CONTACT ---------- */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-info-panel,
  .contact-form-panel {
    padding: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* ---------- FOOTER ---------- */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-social {
    justify-content: center;
  }

  .contact-info li {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  /* ---------- CTA ---------- */
  .cta-content h2 {
    font-size: 2rem;
  }

  /* ---------- MISC ---------- */
  .custom-cursor,
  .custom-cursor-follower {
    display: none !important;
  }

  * {
    -webkit-overflow-scrolling: touch;
  }

  .project-modal {
    margin: 1rem;
    max-height: 85vh;
  }
  .project-modal-body {
    padding: 1.25rem;
  }
  .project-modal-body h2 {
    font-size: 1.2rem;
  }

  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ---------- SMALL MOBILE (up to 480px) ---------- */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .hero-visual {
    height: 250px;
  }

  .floating-card {
    font-size: 0.7rem;
    padding: 6px 12px;
  }

  .team-image {
    width: 90px;
    height: 90px;
  }

  .partner-card .partner-image {
    width: 85px;
    height: 85px;
  }

  .team-info h3 {
    font-size: 1.1rem;
  }

  .team-role {
    font-size: 0.7rem;
  }

  .team-info p {
    font-size: 0.8rem;
  }

  .team-skills span {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .btn-primary,
  .btn-outline {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .story-content h2 {
    font-size: 1.5rem;
  }

  .story-stats {
    justify-content: center;
  }

  .portfolio-card {
    margin: 0 0.5rem;
  }

  .contact-item i {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .contact-social a {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}

/* ---------- TABLET (768px to 1024px) ---------- */
@media (min-width: 768px) and (max-width: 1024px) {
  .hero-title {
    font-size: 3rem;
  }

  .services-grid,
  .services-grid-detailed {
    grid-template-columns: repeat(2, 1fr);
  }

  .partners-grid,
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    gap: 2rem;
  }

  .story-grid {
    gap: 2rem;
  }
}

/* ---------- DESKTOP LARGE (1400px+) ---------- */
@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }

  .hero-title {
    font-size: 5rem;
  }
}

/* ---------- PRINT STYLES ---------- */
@media print {
  .navbar,
  .custom-cursor,
  .loader,
  .scroll-indicator,
  .cta-section,
  .footer-social,
  .btn-glow,
  .btn-primary,
  .btn-outline,
  .whatsapp-float {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .gradient-text {
    color: black;
    background: none;
    -webkit-text-fill-color: black;
  }
}

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

  .story-image {
    max-height: 300px;
  }

  .story-image video {
    max-height: 300px;
  }

  .story-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }
}