/* ==============================================
   CORRECCIONES ESPECÍFICAS PARA MÓVILES
   - Evita que el contenido se vea maximizado
   - Mejora la experiencia de usuario en dispositivos móviles
   ============================================== */

/* Configuración base para prevenir overflow y zoom */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Prevenir zoom en inputs para iOS */
input, select, textarea {
  font-size: 16px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0;
}

/* ==============================================
   CORRECCIONES HERO SECTION MÓVIL
   ============================================== */

@media (max-width: 768px) {
  .hero-section {
    min-height: auto;
    padding: 40px 20px 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
  }

  .hero-content {
    width: 100%;
    max-width: 400px;
    text-align: center;
    padding: 0 15px;
  }

  .hero-logo-circle {
    width: 140px;
    height: 140px;
    margin: 0 auto 8px;
  }

  .hero-content h1 {
    font-size: 2em;
    line-height: 1.1;
    margin: 0 0 3px 0;
  }

  .hero-subtitle {
    font-size: 1.1em;
    margin-bottom: 3px;
    line-height: 1.3;
  }

  .hero-description {
    font-size: 0.95em;
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 12px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 350px;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 70px 15px 40px;
  }

  .hero-content {
    max-width: 320px;
    padding: 0 10px;
  }

  .hero-logo-circle {
    width: 110px;
    height: 110px;
    margin-bottom: 15px;
  }

  .hero-content h1 {
    font-size: 1.6em;
  }

  .hero-subtitle {
    font-size: 1em;
  }

  .hero-description {
    font-size: 0.9em;
    margin-bottom: 20px;
  }

  .hero-buttons {
    max-width: 250px;
    gap: 10px;
    margin-bottom: 25px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 300px;
  }

  .stat {
    padding: 8px 5px;
  }

  .stat-number {
    font-size: 1.3em;
  }

  .stat-label {
    font-size: 0.75em;
    line-height: 1.2;
  }
}

/* ==============================================
   CORRECCIONES SLIDES MÓVIL
   ============================================== */

@media (max-width: 768px) {
  .slides-container {
    padding: 0;
  }

  .section-title {
    padding: 50px 20px 30px;
  }

  .section-title h2 {
    font-size: 1.8em;
  }

  .slide {
    flex-direction: column;
    min-height: auto;
  }

  .slide:nth-child(even) {
    flex-direction: column;
  }

  .slide-image {
    height: 200px;
    width: 100%;
  }

  .slide-content {
    padding: 25px 20px;
  }

  .slide-content h3 {
    font-size: 1.4em;
    margin-bottom: 12px;
  }

  .slide-actions {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .btn-catalog, .btn-buy {
    width: 100%;
    max-width: 250px;
  }
}

@media (max-width: 480px) {
  .section-title {
    padding: 30px 15px 20px;
  }

  .section-title h2 {
    font-size: 1.5em;
  }

  .slide-image {
    height: 180px;
  }

  .slide-content {
    padding: 20px 15px;
  }

  .slide-content h3 {
    font-size: 1.2em;
  }

  .slide-content p {
    font-size: 0.9em;
  }

  .slide-features span {
    font-size: 0.8em;
    padding: 3px 6px;
  }
}

/* ==============================================
   CORRECCIONES HEADER MÓVIL
   ============================================== */

@media (max-width: 768px) {
  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 10px 0;
  }

  .header-content {
    padding: 0 15px;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }

  .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .logo-circle {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
  }
  
  .logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  
  .logo-text {
    text-align: center;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  header {
    padding: 8px 0;
  }

  .header-content {
    padding: 0 12px;
    gap: 8px;
  }

  .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .logo-circle {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
  }
  
  .logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  
  .logo-text {
    text-align: center;
    white-space: nowrap;
  }

  .cart-btn-modern {
    padding: 6px 8px;
    font-size: 0.8em;
  }

  .cart-count-modern {
    min-width: 14px;
    height: 14px;
    font-size: 0.65em;
  }
}

/* ==============================================
   NAVEGACIÓN MÓVIL
   ============================================== */

@media (max-width: 768px) {
  .nav-menu {
    left: -100%;
    width: 80%;
    max-width: 280px;
    transition: left 0.3s ease;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-link {
    padding: 15px 20px;
    font-size: 1em;
  }
}

/* ==============================================
   FOOTER MÓVIL
   ============================================== */

@media (max-width: 768px) {
  footer {
    padding: 40px 20px 20px;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (max-width: 480px) {
  footer {
    padding: 30px 15px 15px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  .footer-section h4 {
    font-size: 1em;
    margin-bottom: 10px;
  }

  .footer-section p,
  .footer-section a {
    font-size: 0.85em;
  }
}

/* ==============================================
   UTILIDADES MÓVIL
   ============================================== */

/* Prevenir elementos que se salen del viewport */
@media (max-width: 768px) {
  * {
    max-width: 100%;
    box-sizing: border-box;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  .whatsapp-float {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
    font-size: 1.4em;
  }
}

/* Fix para landscape en móvil */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    min-height: 100vh;
    padding: 50px 20px 30px;
  }

  .hero-content {
    justify-content: center;
  }

  .hero-logo-circle {
    width: 80px;
    height: 80px;
  }

  .hero-content h1 {
    font-size: 1.5em;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
  }
}

/* ==============================================
   CARRITO MÓVIL MEJORADO
   ============================================== */

@media (max-width: 768px) {
  .cart-content {
    width: 90%;
    height: 80vh;
    max-height: 80vh;
  }

  .cart-items {
    max-height: calc(80vh - 200px);
  }
}

@media (max-width: 480px) {
  .cart-content {
    width: 95%;
    height: 85vh;
    border-radius: 10px;
  }

  .cart-header {
    padding: 12px 15px;
  }

  .cart-items {
    padding: 12px;
    max-height: calc(85vh - 180px);
  }

  .cart-footer {
    padding: 12px 15px;
  }

  .cart-actions button {
    padding: 8px 15px;
    font-size: 0.85em;
  }
}

/* ==============================================
   FORMULARIOS MÓVIL
   ============================================== */

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .cotizacion-form-container,
  .personalizado-form-container {
    margin: 0 -20px;
    border-radius: 0;
    padding: 25px 20px;
  }
}

@media (max-width: 480px) {
  .cotizacion-form-container,
  .personalizado-form-container {
    padding: 20px 15px;
  }

  .form-group label {
    font-size: 0.95em;
  }

  .cotizacion-form input,
  .cotizacion-form select,
  .cotizacion-form textarea,
  .personalizado-form input,
  .personalizado-form select,
  .personalizado-form textarea {
    padding: 12px 15px;
    font-size: 16px;
  }
}