/**
 * Archivo consolidado para correcciones de layout y componentes
 * Consolida: hero-image-fix.css, menu-fixes.css, critical-navbar.css,
 * mobile-buttons-fix.css, image-optimization.css, contrast-enhancement.css
 */

/* ========================================
   NAVEGACIÓN Y HEADER
   ======================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
    background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 600;
  color: #1f2937;
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.hamburger-menu {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 20px;
  height: 20px;
}

.hamburger-menu span {
  width: 100%;
  height: 2px;
  background-color: #374151;
  transition: all 0.3s ease;
}

/* Logo optimizado */
.logo-header {
  height: auto;
  max-height: 60px;
  width: auto;
  max-width: 200px;
}

/* ========================================
   MENÚS DROPDOWN
   ======================================== */

.dropdown-menu {
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
}

/* Mega menu */
.mega-menu {
  min-width: 600px;
  border-radius: 0.5rem;
}

/* ========================================
   RESPONSIVE MOBILE
   ======================================== */

@media (max-width: 991.98px) {
  .navbar-collapse {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: white;
    border-left: 1px solid #e5e7eb;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
        overflow-y: auto;
    padding: 1rem;
  }
  
  .navbar-collapse.show {
    transform: translateX(0);
      }
  
  .navbar-nav {
    flex-direction: column;
    margin-top: 2rem;
  }
  
  .dropdown-menu {
    position: static !important;
    float: none !important;
    width: 100% !important;
    margin-top: 0;
    box-shadow: none;
    border: none;
    background: #f8f9fa;
  }
  
  .mega-menu {
    min-width: auto;
  }
}

#navbarSupportedContent.show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ========================================
   IMAGEN DEL HERO
   ======================================== */

.hero-image-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

.responsive-hero-image {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3/2;
  object-fit: cover;
  object-position: center;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ========================================
   RESPONSIVE HERO
   ======================================== */

@media (max-width: 768px) {
  .hero-image-wrapper {
    max-width: 100%;
    margin: 1rem auto;
    padding: 0 1rem;
  }
  
  .responsive-hero-image {
    aspect-ratio: 4/3;
  }
  
  .hero-content-wrapper {
    min-height: auto !important;
    padding: 1rem 0;
  }
  
  .hero-section {
    min-height: auto !important;
    padding: 2rem 0;
    overflow: hidden;
  }
  
  .col-lg-6.text-center {
    padding: 0;
    margin: 0;
  }
}

@media (max-width: 576px) {
  .hero-image-wrapper {
    padding: 0 0.5rem;
  }
  
  .responsive-hero-image {
    aspect-ratio: 1/1;
    border-radius: 0.5rem;
  }
  
  .hero-section {
    padding: 1rem 0;
  }
  
  .hero-content-wrapper {
    padding: 0.5rem 0;
  }
}

/* Asegurar que la imagen no cause overflow horizontal */
.hero-section,
.hero-content-wrapper,
.container,
.row {
  overflow-x: hidden;
}

/* ========================================
   OPTIMIZACIÓN DE IMÁGENES
   ======================================== */

/* Todas las imágenes deben ser responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Imágenes lazy loading */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Placeholder para imágenes que cargan */
.image-placeholder {
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border-radius: 0.5rem;
}

/* ========================================
   BOTONES MOBILE
   ======================================== */

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
  
  /* Botones más grandes en móvil */
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  .btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
  }
}

/* ========================================
   MEJORAS DE CONTRASTE
   ======================================== */

/* Texto sobre fondos claros */
.bg-light,
.bg-white {
  color: #374151 !important;
}

/* Texto sobre fondos oscuros */
.bg-dark,
.bg-primary {
  color: white !important;
}

/* Enlaces con mejor contraste */
a:not(.btn) {
  color: #1d4ed8;
  text-decoration: none;
}

a:not(.btn):hover {
  color: #1e40af;
  text-decoration: underline;
}

/* ========================================
   ANIMACIONES SUAVES
   ======================================== */

/* Transiciones suaves para elementos interactivos */
.nav-link,
.btn,
.dropdown-item {
  transition: all 0.2s ease;
}

/* Hover effects sutiles */
.nav-link:hover,
.dropdown-item:hover {
  transform: translateY(-1px);
}

/* ========================================
   OPTIMIZACIONES DE PERFORMANCE
   ======================================== */

/* Contain layout para mejor performance */
.navbar,
.hero-section,
.card {
  contain: layout style;
}

/* Will-change para elementos animados */
.navbar-collapse,
.dropdown-menu {
  will-change: transform, opacity;
}

/* Optimizar scroll en móvil */
.navbar-collapse {
  -webkit-overflow-scrolling: touch;
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */

/* Focus visible para navegación por teclado */
.nav-link:focus,
.btn:focus,
.dropdown-item:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #2563eb;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
    transition: top 0.3s ease;
}

.skip-link:focus {
  top: 6px;
}