/* ================================
   RESPONSIVE — Code Imperium
   Breakpoints:
   - 768px: tablets
   - 480px: móviles
================================ */

/* ================================
   NAVBAR
================================ */
@media (max-width: 768px) {
  .navbar {
    padding: 0 20px;
    height: 65px;
    position: relative;
  }

.hero-visual {
  display: none;
}
  .logo img {
    height: 45px;
  }

  .brand-imperium {
    font-size: 15px;
  }

  .brand-code {
    font-size: 12px;
  }

  /* Ocultar links y botón en móvil */
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 65px;
    left: 0;
    width: 100%;
    background: rgba(5,5,5,0.98);
    border-bottom: 1px solid rgba(0,255,136,0.15);
    padding: 20px;
    gap: 16px;
    z-index: 100;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .nav-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
  }

  /* Botón hamburguesa */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
  }

  .nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* Ocultar toggle en desktop */
@media (min-width: 769px) {
  .nav-toggle {
    display: none;
  }
}

/* ================================
   HERO
================================ */
@media (max-width: 768px) {
  .hero {
    padding: 60px 24px 80px;
    min-height: auto;
    align-items: center;
    background-position: center center;
  }

  .hero::before {
    background: linear-gradient(
      to bottom,
      rgba(0,0,0,0.92) 0%,
      rgba(0,0,0,0.85) 60%,
      rgba(0,0,0,0.75) 100%
    );
  }

  .hero-text {
    max-width: 100%;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 36px;
    line-height: 1.1;
  }

  .hero-text p {
    font-size: 15px;
    max-width: 100%;
    margin-top: 20px;
  }

  .cta {
    margin-top: 28px;
    padding: 14px 28px;
    font-size: 15px;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 30px;
  }
}

/* ================================
   SERVICIOS
================================ */
@media (max-width: 768px) {
  .services {
    padding: 80px 20px;
  }

  .services-header h2 {
    font-size: 32px;
  }

  .services-header p {
    font-size: 15px;
  }

  .services-stats {
    gap: 30px;
    margin: 40px 0 60px;
  }

  .stat h3 {
    font-size: 28px;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .service-card {
    padding: 28px 20px;
  }

  /* En móvil mostrar features y botón siempre visibles */
  .service-features {
    opacity: 1;
    max-height: 200px;
    margin-bottom: 14px;
  }

  .service-btn {
    opacity: 1;
    transform: translateY(0);
  }

  .services-cta {
    margin-top: 60px;
  }

  .cta-secondary {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
  }
}

/* ================================
   PANEL DE SERVICIO
================================ */
@media (max-width: 768px) {
  .service-panel {
    width: 100%;
    padding: 30px 20px;
  }
}

/* ================================
   TESTIMONIOS
================================ */
@media (max-width: 768px) {
  .testimonials {
    padding: 80px 20px;
  }

  .testimonial-title {
    font-size: 26px;
    margin-bottom: 40px;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .testimonial-card {
    padding: 24px;
  }

  .testimonials-cta {
    margin-top: 60px;
  }

  .testimonials-cta h3 {
    font-size: 20px;
  }

  .testimonials-cta .cta-secondary {
    width: 100%;
  }
}

/* ================================
   STACK & METODOLOGÍA
================================ */
@media (max-width: 768px) {
  .stack {
    padding: 80px 20px;
  }

  .stack-title {
    font-size: 1.8rem;
  }

  .stack-subtitle {
    font-size: 0.9rem;
  }

  .stack-container {
    grid-template-columns: 1fr;
    gap: 50px;
    margin-top: 50px;
  }

  .method-steps {
    gap: 20px;
  }

  .method-item h4 {
    font-size: 17px;
  }

  .method-item p {
    font-size: 14px;
  }

  .tech-architecture {
    gap: 16px;
  }

  .tech-layer {
    padding: 14px 16px;
  }

  .tech-items {
    gap: 12px;
  }

  .tech-item {
    font-size: 0.85rem;
  }
}

/* ================================
   CONTACTO
================================ */
@media (max-width: 768px) {
  .contact {
    padding: 80px 20px;
  }

  .contact-header h2 {
    font-size: 28px;
  }

  .contact-card {
    padding: 28px 20px;
  }

  .scheduler-body {
    padding: 18px;
  }

  .horas {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-contact {
    min-width: unset;
    width: 100%;
  }
}

/* ================================
   CHATBOT
================================ */
@media (max-width: 768px) {
  .chatbot {
    width: calc(100% - 24px);
    right: 12px;
    bottom: 12px;
    height: 75vh;
    max-height: 560px;
    border-radius: 16px;
  }

  .chatbot-burbuja {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }

  .chatbot-burbuja img {
    width: 40px;
    height: 40px;
  }

  .chatbot-btn-rapido {
    font-size: 12px;
    padding: 7px 10px;
  }

  .burbuja {
    font-size: 13px;
  }
}

/* ================================
   TOAST
================================ */
@media (max-width: 480px) {
  .toast {
    width: 90%;
    white-space: normal;
    text-align: center;
    font-size: 14px;
    padding: 14px 18px;
  }
}

/* ================================
   MODAL FORMULARIO
================================ */
@media (max-width: 480px) {
  .modal-contenido {
    padding: 24px 18px;
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
  }
}

@media (max-width: 768px) {
  .hero-visual {
    display: block;
    position: relative;
    z-index: 2;
    margin-top: 30px;
    text-align: center;
  }

  .hero-visual img {
    width: 100%;
    max-width: 320px;
    border-radius: 16px;
  }
}