/**
 * Utilware Solutions - Estilos para Móviles y Responsividad
 */

/* ===== HAMBURGER MENU ===== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  transition: all 0.3s ease;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(9.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-9.5px) rotate(-45deg);
}

/* ===== HEADER STICKY ===== */
header {
  position: sticky;
  top: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1000;
  background: white;
}

header.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header.hide {
  transform: translateY(-100%);
}

/* ===== ANIMACIONES DE SCROLL ===== */
[data-cdhs] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-cdhs].fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* ===== ESTILOS DE FORMULARIOS ===== */
.form-message {
  padding: 15px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

.form-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

input.error,
textarea.error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
  .container {
    padding: 0 30px;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }
}

/* Móviles y pantallas pequeñas */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  /* Navegación móvil */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: white;
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    padding-top: 80px;
  }

  nav.mobile-active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    padding: 20px;
  }

  nav ul li {
    margin: 15px 0;
  }

  nav ul li a {
    font-size: 1.2rem;
    padding: 15px;
    display: block;
  }

  .container {
    padding: 0 20px;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  /* Ajustar padding de secciones */
  section {
    padding: 40px 0;
  }

  /* Grid responsive */
  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Botones en móvil */
  .button,
  .btn {
    width: 100%;
    text-align: center;
  }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 15px;
  }

  section {
    padding: 30px 0;
  }
}

/* ===== UTILIDADES RESPONSIVE ===== */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }

  .mobile-hidden {
    display: none !important;
  }
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
*:focus {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

button:focus,
a:focus {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

/* Reducir movimiento para usuarios que lo prefieran */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
