/* =========================================
   NAV GLOBAL FIXES (ANTES DE MEDIA QUERIES)
========================================= */

/* Evitar FOUC cuando el nav se carga por fetch */
.nav-menu {
  visibility: hidden;
}

.nav-menu.is-ready {
  visibility: visible;
}

/* Overlay oscuro detrás del menú mobile */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1500;
}

.nav-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

/* ===============================
   RESPONSIVE
   Orden: de mayor a menor breakpoint
================================== */


/* ===============================
   NOTEBOOKS / LAPTOPS (1366px)
================================== */

@media (max-width: 1366px) {

  /* NAV */
  .nav-container {
    max-width: 1100px;
    padding: 0 30px;
  }

  .nav-links {
    gap: 25px;
  }

  /* HERO */
  .hero {
    min-height: 85vh;
    padding: 80px 30px;
  }

  .hero-title {
    font-size: 48px;
    line-height: 1.15;
  }

  .hero-description {
    font-size: 17px;
    max-width: 650px;
    margin: 0 auto 40px;
  }

  .hero-buttons {
    gap: 15px;
  }

  .btn-primary,
  .btn-outline {
    padding: 12px 22px;
    font-size: 14px;
  }

  .hero-badge {
    font-size: 13px;
    padding: 6px 14px;
  }

  /* TRUSTED */
  .trusted-track span {
    font-size: 18px;
    margin: 0 50px;
  }

  /* SERVICES */
  .services-container {
    max-width: 1000px;
  }

  /* EXPERTISE */
  .expertise-row {
    gap: 60px;
  }

  .expertise-content h2 {
    font-size: 36px;
  }

  /* PROJECTS */
  .projects-container {
    max-width: 1100px;
  }

  .projects-grid {
    gap: 25px;
  }

  /* CTA */
  .cta-container h2 {
    font-size: 42px;
  }
}


/* ===============================
   1280px
================================== */

@media (max-width: 1280px) {

  .hero-title {
    font-size: 44px;
  }

  .hero-description {
    font-size: 16px;
  }

  .hero {
    min-height: 80vh;
  }
}


/* ===============================
   1200px
================================== */

@media (max-width: 1200px) {

  .hero-title {
    font-size: 48px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .expertise-row {
    gap: 40px;
  }
}


/* ===============================
   NAV RESPONSIVE + 992px
================================== */

@media (max-width: 992px) {

  /* Bloquear botón flotante si menú abierto */
  body.mobile-menu-open .floating-cta {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  /* Mostrar hamburguesa */
  .nav-toggle {
    display: block;
  }

  /* Ocultar CTA desktop */
  .nav-cta {
    display: none;
  }

  /* Mostrar elementos mobile */
  .mobile-header,
  .mobile-cta {
    display: block;
  }

  /* Panel lateral */
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background-color: #0f172a;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 40px 25px;

    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(.77,0,.18,1);

    z-index: 2000;
  }

  /* Estado abierto */
  .nav-menu.is-open {
    transform: translateX(0);
  }

  /* Header mobile interno */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-bottom: 20px;
  }

  .mobile-header h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 600;
    margin: 0;
  }

  .close-menu {
    background: none;
    border: none;
    font-size: 28px;
    color: #ffffff;
    cursor: pointer;
  }

  /* Links verticales */
  .nav-links {
    flex-direction: column;
    gap: 30px;
    margin-top: 80px;
  }

  .nav-links a {
    font-size: 22px;
    color: #e2e8f0;
  }

  /* CTA mobile */
  .mobile-cta {
    margin-bottom: 40px;
  }

  .btn-cta-mobile {
    display: block;
    text-align: center;
    padding: 18px;
    background: linear-gradient(90deg, #7c3aed, #6366f1);
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-radius: 40px;
    font-size: 16px;
  }

  /* Expertise */
  .expertise-row {
    grid-template-columns: 1fr;
    gap: 50px;
    margin-bottom: 100px;
  }

  .expertise-row.reverse {
    direction: ltr;
  }

  .expertise-content h2 {
    font-size: 36px;
  }

  /* Projects */
  .projects-header {
    flex-direction: column;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }

  /* Contact */
  .contact-container {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .contact-left {
    position: static;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }
}


/* ===============================
   768px
================================== */

@media (max-width: 768px) {

  .hero-title {
    font-size: 42px;
  }

  .hero-description {
    font-size: 16px;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    pointer-events: auto;
    -webkit-tap-highlight-color: rgba(139, 92, 246, 0.2);
  }

  .trusted-track {
    gap: 60px;
  }

  .trusted-track span {
    font-size: 18px;
  }

  .services-title {
    font-size: 40px;
  }

  .service-header h3 {
    font-size: 22px;
  }

  .service-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}


/* ===============================
   600px
================================== */

@media (max-width: 600px) {

  .footer-container {
    grid-template-columns: 1fr;
  }

  .cta h2 {
    font-size: 36px;
  }

  /* Contact */
  .contact-page {
    padding: 100px 16px 60px;
  }

  .contact-title {
    font-size: 48px;
  }

  .contact-description {
    font-size: 1.125rem;
    margin-bottom: 48px;
  }

  /* Cotización */
  .quote-page {
    padding: 110px 16px 80px;
  }

  .quote-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .quote-left {
    position: static;
  }
}


/* ===============================
   Floating Button (480px)
================================== */

@media (max-width: 480px) {

  .floating-cta {
    bottom: 16px;
    right: 16px;
  }

  .floating-cta-toggle {
    padding: 12px 16px;
    font-size: 14px;
    gap: 8px;
  }

  .floating-cta-text {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .floating-cta-dropdown {
    min-width: 200px;
    right: 0;
  }
}