
/* ==============================================
   RESPONSIVE DESIGN SYSTEM - YACHAY
   ============================================== */

/* Desktop grande (min-width: 1390px) */
@media (min-width: 1390px) {
  .header-container {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Tablets y Laptops pequeños (768px - 1390px) - Mantener botones normales lado a lado */
@media (max-width: 1390px) and (min-width: 768px) {
  /* Base adjustments para pantallas medianas */
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 var(--spacing-lg);
  }

  /* Typography */
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }

  /* Grid Systems - Más compactos pero no mobile */
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }

  /* Hero - Layout centrado pero botones lado a lado */
  .hero {
    min-height: auto;
    padding: 120px 0 var(--spacing-3xl);
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }



  .hero-content {
    text-align: center;
  }

  .hero-description {
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: nowrap; /* MANTENER LADO A LADO */
  }

  .hero-actions .btn {
    flex: 0 1 auto;
    min-width: 160px;
    max-width: 200px;
    /* NO width: 100% */
  }

  .hero-stats {
    justify-content: center;
  }

  /* INDEX específico - botones CTA lado a lado */
  .index-page .index-cta-buttons {
    flex-wrap: nowrap;
    gap: var(--spacing-md);
  }

  .index-page .index-cta-buttons .btn {
    flex: 0 1 auto;
    min-width: 160px;
    max-width: 200px;
    /* NO width: 100% */
  }


}

/* Tablets pequeños específico (769px - 1060px) */
@media (max-width: 1060px) and (min-width: 769px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .hero-actions .btn {
    min-width: 140px;
    max-width: 180px;
  }

  .index-page .index-cta-buttons .btn {
    min-width: 140px;
    max-width: 180px;
  }

  /* Solo para tablets pequeños: ocultar hero-visual para ahorrar espacio */
  .hero-visual {
    display: none;
  }

  /* Hero-container en tablets: centrado sin visual */
  .hero-container {
    display: block;
    text-align: center;
  }
}  .hero-features {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    margin-left: 0;
    transform: none;
  }

  /* .floating-card {
    display: none;
  } */

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }
}

/* Mobile y Tablets pequeñas (max-width: 1390px) */
@media (max-width: 1390px) {
  /* Base */
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  /* Header móvil - ELIMINADO: se maneja completamente en header.css */



  /* Typography */
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  /* Spacing */
  .section {
    padding: var(--spacing-2xl) 0;
  }

  /* Grid System mejorado */
  .grid-2 {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  /* Grid para tablets */
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }



  /* Header móvil */
  .header-container {
    padding: 2px 0; /* Consistente con desktop */
  }

  .nav-menu {
    flex-direction: column;
    gap: var(--spacing-lg);
    width: 100%;
  }

  .nav-link {
    font-size: var(--text-lg);
    padding: var(--spacing-md) 0;
    width: 100%;
  }

  .nav-actions {
    flex-direction: column;
    width: 100%;
    margin-top: var(--spacing-xl);
    gap: var(--spacing-md);
  }

  .nav-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .nav-actions .user-menu {
    width: 100%;
    flex-direction: column;
  }

  .nav-actions form {
    width: 100%;
  }

  /* CSS base para menú hamburguesa */
  .menu-toggle,
  .yachay-mobile-toggle,
  .header .menu-toggle,
  .yachay-main-header .yachay-mobile-toggle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-around !important;
    align-items: center !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 8px !important;
    width: 40px !important;
    height: 40px !important;
    position: relative !important;
    z-index: 1001 !important;
  }

  .menu-toggle span,
  .yachay-mobile-toggle span,
  .header .menu-toggle span,
  .yachay-main-header .yachay-mobile-toggle span {
    display: block !important;
    width: 25px !important;
    height: 3px !important;
    background: #333 !important;
    border-radius: 3px !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    transform-origin: center !important;
    position: relative !important;
  }

  /* Modo oscuro para líneas del hamburguesa */
  .dark-mode .menu-toggle span,
  .dark-mode .yachay-mobile-toggle span,
  .dark-mode .header .menu-toggle span,
  .dark-mode .yachay-main-header .yachay-mobile-toggle span,
  [data-theme="dark"] .menu-toggle span,
  [data-theme="dark"] .yachay-mobile-toggle span,
  [data-theme="dark"] .header .menu-toggle span,
  [data-theme="dark"] .yachay-main-header .yachay-mobile-toggle span {
    background: #fff !important;
  }

  /* Animación del hamburguesa */
  .menu-toggle.active span:nth-child(1),
  .yachay-mobile-toggle.active span:nth-child(1),
  .header .menu-toggle.active span:nth-child(1),
  .yachay-main-header .yachay-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px) !important;
  }

  .menu-toggle.active span:nth-child(2),
  .yachay-mobile-toggle.active span:nth-child(2),
  .header .menu-toggle.active span:nth-child(2),
  .yachay-main-header .yachay-mobile-toggle.active span:nth-child(2) {
    opacity: 0 !important;
  }

  .menu-toggle.active span:nth-child(3),
  .yachay-mobile-toggle.active span:nth-child(3),
  .header .menu-toggle.active span:nth-child(3),
  .yachay-main-header .yachay-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px) !important;
  }

  .nav,
  .yachay-main-nav,
  #navMenu {
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: 80% !important;
    max-width: 320px !important;
    height: 100vh !important;
    background: var(--bg-primary, #ffffff) !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 100px 1.5rem 1.5rem !important;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15) !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1000 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .nav.active,
  .yachay-main-nav.active,
  #navMenu.active {
    left: 0 !important;
  }

  /* Mostrar nav-actions dentro del menú móvil usando ::after pseudo-element */
  .nav.active::after,
  .yachay-main-nav.active::after,
  #navMenu.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: auto !important;
  }

  /* Ocultar completamente nav-actions normales del header en móvil */
  .header-container .nav-actions,
  .yachay-header-wrap .yachay-nav-buttons {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
  }

  /* Ocultar botón de tema original en móvil para evitar duplicación */
  .theme-toggle-btn,
  #theme-toggle,
  .header .theme-toggle-btn,
  .yachay-main-header .theme-toggle-btn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
  }

  /* Contenedor de botones móviles - Fondo predeterminado, solo borde blanco */
  .nav .nav-actions-mobile,
  .yachay-main-nav .nav-actions-mobile,
  #navMenu .nav-actions-mobile {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    margin-top: 2.5rem !important;
    padding: 2rem 1.5rem 1.5rem !important;
    background: inherit !important;
    border-radius: 15px !important;
    width: calc(100% + 3rem) !important;
    margin-left: -1.5rem !important;
    margin-right: -1.5rem !important;
    position: relative !important;
    border: none !important;
    /* Forzar actualización para modo incógnito */
    animation: forceUpdate 0.1s linear !important;
  }

  /* Animación para forzar actualización en modo incógnito */
  @keyframes forceUpdate {
    0% { opacity: 0.99; }
    100% { opacity: 1; }
  }

  /* Efecto decorativo superior */
  .nav .nav-actions-mobile::before,
  .yachay-main-nav .nav-actions-mobile::before,
  #navMenu .nav-actions-mobile::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 40px !important;
    height: 4px !important;
    background: #cbd5e1 !important;
    border-radius: 2px !important;
    margin-top: -2px !important;
  }

  /* Botón de tema - Solo borde blanco */
  .nav .nav-actions-mobile .theme-toggle-btn,
  .nav .nav-actions-mobile #theme-toggle-mobile,
  .yachay-main-nav .nav-actions-mobile .theme-toggle-btn,
  .yachay-main-nav .nav-actions-mobile #theme-toggle-mobile,
  #navMenu .nav-actions-mobile .theme-toggle-btn,
  #navMenu .nav-actions-mobile #theme-toggle-mobile {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin: 0 auto 16px !important;
    padding: 0 !important;
    font-size: 18px !important;
    transition: all 0.3s ease !important;
    order: -1 !important;
    position: relative !important;
    cursor: pointer !important;
    box-shadow: none !important;
  }

  /* Centrar perfectamente el icono del botón de tema */
  .nav .nav-actions-mobile .theme-toggle-btn i,
  .nav .nav-actions-mobile #theme-toggle-mobile i,
  .yachay-main-nav .nav-actions-mobile .theme-toggle-btn i,
  .yachay-main-nav .nav-actions-mobile #theme-toggle-mobile i,
  #navMenu .nav-actions-mobile .theme-toggle-btn i,
  #navMenu .nav-actions-mobile #theme-toggle-mobile i {
    font-size: 18px !important;
    line-height: 1 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hover del botón de tema */
  .nav .nav-actions-mobile .theme-toggle-btn:hover,
  .nav .nav-actions-mobile #theme-toggle-mobile:hover,
  .yachay-main-nav .nav-actions-mobile .theme-toggle-btn:hover,
  .yachay-main-nav .nav-actions-mobile #theme-toggle-mobile:hover,
  #navMenu .nav-actions-mobile .theme-toggle-btn:hover,
  #navMenu .nav-actions-mobile #theme-toggle-mobile:hover {
    transform: scale(1.1) !important;
    border-width: 4px !important;
  }

  /* Estilos para otros botones del menú móvil - como los originales */
  .nav .nav-actions-mobile .btn,
  .nav .nav-actions-mobile .user-menu-btn,
  .nav .nav-actions-mobile .yachay-nav-btn,
  .nav .nav-actions-mobile a,
  .yachay-main-nav .nav-actions-mobile .btn,
  .yachay-main-nav .nav-actions-mobile .user-menu-btn,
  .yachay-main-nav .nav-actions-mobile .yachay-nav-btn,
  .yachay-main-nav .nav-actions-mobile a,
  #navMenu .nav-actions-mobile .btn,
  #navMenu .nav-actions-mobile .user-menu-btn,
  #navMenu .nav-actions-mobile .yachay-nav-btn,
  #navMenu .nav-actions-mobile a {
    background: #007bff !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 20px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 5px 0 !important;
    min-height: 44px !important;
  }

  /* Hover de otros botones */
  .nav .nav-actions-mobile .btn:hover,
  .nav .nav-actions-mobile .user-menu-btn:hover,
  .nav .nav-actions-mobile .yachay-nav-btn:hover,
  .nav .nav-actions-mobile a:hover,
  .yachay-main-nav .nav-actions-mobile .btn:hover,
  .yachay-main-nav .nav-actions-mobile .user-menu-btn:hover,
  .yachay-main-nav .nav-actions-mobile .yachay-nav-btn:hover,
  .yachay-main-nav .nav-actions-mobile a:hover,
  #navMenu .nav-actions-mobile .btn:hover,
  #navMenu .nav-actions-mobile .user-menu-btn:hover,
  #navMenu .nav-actions-mobile .yachay-nav-btn:hover,
  #navMenu .nav-actions-mobile a:hover {
    background: rgba(0, 123, 255, 0.1) !important;
    color: #007bff !important;
    transform: translateY(-2px) !important;
    border: none !important;
  }

  .nav .nav-actions-mobile .theme-toggle-btn:hover::after,
  .nav .nav-actions-mobile #theme-toggle-mobile:hover::after,
  .yachay-main-nav .nav-actions-mobile .theme-toggle-btn:hover::after,
  .yachay-main-nav .nav-actions-mobile #theme-toggle-mobile:hover::after,
  #navMenu .nav-actions-mobile .theme-toggle-btn:hover::after,
  #navMenu .nav-actions-mobile #theme-toggle-mobile:hover::after {
    opacity: 0.3 !important;
    transform: scale(1.2) !important;
  }

  /* Botones individuales - Diseño base (excluye tema) */
  .nav .nav-actions-mobile .btn:not(.theme-toggle-btn),
  .yachay-main-nav .nav-actions-mobile .btn:not(.theme-toggle-btn),
  #navMenu .nav-actions-mobile .btn:not(.theme-toggle-btn) {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 16px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-align: center !important;
    white-space: nowrap !important;
    min-height: 48px !important;
    border: 2px solid transparent !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    overflow: hidden !important;
  }

  /* Hover effects para botones móviles */
  .nav .nav-actions-mobile .btn:hover,
  .yachay-main-nav .nav-actions-mobile .btn:hover,
  #navMenu .nav-actions-mobile .btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  }

  /* Iconos en botones móviles */
  .nav .nav-actions-mobile .btn i,
  .yachay-main-nav .nav-actions-mobile .btn i,
  #navMenu .nav-actions-mobile .btn i {
    margin-right: 10px !important;
    font-size: 16px !important;
    opacity: 0.9 !important;
  }

  /* Colores específicos para diferentes tipos de botones */
  .nav .nav-actions-mobile .btn-primary,
  .yachay-main-nav .nav-actions-mobile .btn-primary,
  #navMenu .nav-actions-mobile .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white !important;
    border-color: #2563eb !important;
  }

  .nav .nav-actions-mobile .btn-secondary,
  .yachay-main-nav .nav-actions-mobile .btn-secondary,
  #navMenu .nav-actions-mobile .btn-secondary {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    border-color: #059669 !important;
  }

  .nav .nav-actions-mobile .btn-outline,
  .yachay-main-nav .nav-actions-mobile .btn-outline,
  #navMenu .nav-actions-mobile .btn-outline {
    background: white !important;
    color: #374151 !important;
    border-color: #d1d5db !important;
  }

  /* Botones para usuarios no registrados - Diseño premium */
  .nav .nav-actions-mobile > .btn-secondary:not(.logout-btn),
  .nav .nav-actions-mobile > .btn-primary,
  .yachay-main-nav .nav-actions-mobile > .btn-secondary:not(.logout-btn),
  .yachay-main-nav .nav-actions-mobile > .btn-primary,
  #navMenu .nav-actions-mobile > .btn-secondary:not(.logout-btn),
  #navMenu .nav-actions-mobile > .btn-primary {
    width: 100% !important;
    margin-bottom: 12px !important;
    padding: 18px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 16px !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: none !important;
    position: relative !important;
    overflow: hidden !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
  }

  /* Iniciar Sesión - Azul elegante */
  .nav .nav-actions-mobile > .btn-secondary:not(.logout-btn),
  .yachay-main-nav .nav-actions-mobile > .btn-secondary:not(.logout-btn),
  #navMenu .nav-actions-mobile > .btn-secondary:not(.logout-btn) {
    background: linear-gradient(135deg,
      #6366f1 0%,
      #4f46e5 50%,
      #4338ca 100%) !important;
    color: white !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3) !important;
  }

  .nav .nav-actions-mobile > .btn-secondary:not(.logout-btn):hover,
  .yachay-main-nav .nav-actions-mobile > .btn-secondary:not(.logout-btn):hover,
  #navMenu .nav-actions-mobile > .btn-secondary:not(.logout-btn):hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4) !important;
  }

  /* Registrarse - Verde vibrante */
  .nav .nav-actions-mobile > .btn-primary,
  .yachay-main-nav .nav-actions-mobile > .btn-primary,
  #navMenu .nav-actions-mobile > .btn-primary {
    background: linear-gradient(135deg,
      #10b981 0%,
      #059669 50%,
      #047857 100%) !important;
    color: white !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3) !important;
  }

  .nav .nav-actions-mobile > .btn-primary:hover,
  .yachay-main-nav .nav-actions-mobile > .btn-primary:hover,
  #navMenu .nav-actions-mobile > .btn-primary:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4) !important;
  }

  /* Efectos de brillo en botones */
  .nav .nav-actions-mobile > .btn-secondary:not(.logout-btn)::before,
  .nav .nav-actions-mobile > .btn-primary::before,
  .yachay-main-nav .nav-actions-mobile > .btn-secondary:not(.logout-btn)::before,
  .yachay-main-nav .nav-actions-mobile > .btn-primary::before,
  #navMenu .nav-actions-mobile > .btn-secondary:not(.logout-btn)::before,
  #navMenu .nav-actions-mobile > .btn-primary::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent) !important;
    transition: left 0.5s !important;
  }

  .nav .nav-actions-mobile > .btn-secondary:not(.logout-btn):hover::before,
  .nav .nav-actions-mobile > .btn-primary:hover::before,
  .yachay-main-nav .nav-actions-mobile > .btn-secondary:not(.logout-btn):hover::before,
  .yachay-main-nav .nav-actions-mobile > .btn-primary:hover::before,
  #navMenu .nav-actions-mobile > .btn-secondary:not(.logout-btn):hover::before,
  #navMenu .nav-actions-mobile > .btn-primary:hover::before {
    left: 100% !important;
  }

  .nav .nav-actions-mobile .theme-toggle-btn,
  .yachay-main-nav .nav-actions-mobile .theme-toggle-btn,
  #navMenu .nav-actions-mobile .theme-toggle-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
    color: white !important;
    border-color: #7c3aed !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 8px auto !important;
  }

  /* User menu - Layout horizontal organizado */
  .nav .nav-actions-mobile .user-menu,
  .yachay-main-nav .nav-actions-mobile .user-menu,
  #navMenu .nav-actions-mobile .user-menu {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Primera fila: Botones de rol (Mis Preguntas, Panel Admin, etc.) */
  .nav .nav-actions-mobile .user-menu .btn-preguntas,
  .nav .nav-actions-mobile .user-menu .btn-admin,
  .nav .nav-actions-mobile .user-menu .btn-rechazados,
  .yachay-main-nav .nav-actions-mobile .user-menu .btn-preguntas,
  .yachay-main-nav .nav-actions-mobile .user-menu .btn-admin,
  .yachay-main-nav .nav-actions-mobile .user-menu .btn-rechazados,
  #navMenu .nav-actions-mobile .user-menu .btn-preguntas,
  #navMenu .nav-actions-mobile .user-menu .btn-admin,
  #navMenu .nav-actions-mobile .user-menu .btn-rechazados {
    width: 100% !important;
    order: 1 !important;
  }

  /* Segunda fila: Perfil y Logout lado a lado */
  .nav .nav-actions-mobile .user-menu .perfil-link,
  .nav .nav-actions-mobile .user-menu .logout-form,
  .yachay-main-nav .nav-actions-mobile .user-menu .perfil-link,
  .yachay-main-nav .nav-actions-mobile .user-menu .logout-form,
  #navMenu .nav-actions-mobile .user-menu .perfil-link,
  #navMenu .nav-actions-mobile .user-menu .logout-form {
    order: 2 !important;
  }

  /* Contenedor para perfil y logout (lado a lado) */
  .nav .nav-actions-mobile .user-menu,
  .yachay-main-nav .nav-actions-mobile .user-menu,
  #navMenu .nav-actions-mobile .user-menu {
    display: flex !important;
    flex-wrap: wrap !important;
  }

  .nav .nav-actions-mobile .user-menu .perfil-link,
  .yachay-main-nav .nav-actions-mobile .user-menu .perfil-link,
  #navMenu .nav-actions-mobile .user-menu .perfil-link {
    width: calc(50% - 8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px 12px !important;
    background: linear-gradient(135deg,
      #10b981 0%,
      #059669 50%,
      #047857 100%) !important;
    color: white !important;
    border-radius: 14px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    margin-right: 8px !important;
    border: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow:
      0 4px 15px rgba(16, 185, 129, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    position: relative !important;
    overflow: hidden !important;
  }

  .nav .nav-actions-mobile .user-menu .perfil-link:hover,
  .yachay-main-nav .nav-actions-mobile .user-menu .perfil-link:hover,
  #navMenu .nav-actions-mobile .user-menu .perfil-link:hover {
    transform: translateY(-2px) !important;
    box-shadow:
      0 8px 25px rgba(16, 185, 129, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  }

  .nav .nav-actions-mobile .user-menu .logout-form,
  .yachay-main-nav .nav-actions-mobile .user-menu .logout-form,
  #navMenu .nav-actions-mobile .user-menu .logout-form {
    width: calc(50% - 8px) !important;
    margin-left: 8px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .nav .nav-actions-mobile .user-menu .logout-btn,
  .yachay-main-nav .nav-actions-mobile .user-menu .logout-btn,
  #navMenu .nav-actions-mobile .user-menu .logout-btn {
    width: 100% !important;
    padding: 16px 12px !important;
    background: linear-gradient(135deg,
      #ef4444 0%,
      #dc2626 50%,
      #b91c1c 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 14px !important;
    font-weight: 600 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow:
      0 4px 15px rgba(239, 68, 68, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    cursor: pointer !important;
  }

  .nav .nav-actions-mobile .user-menu .logout-btn:hover,
  .yachay-main-nav .nav-actions-mobile .user-menu .logout-btn:hover,
  #navMenu .nav-actions-mobile .user-menu .logout-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow:
      0 8px 25px rgba(239, 68, 68, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  }

  .nav .nav-actions-mobile .user-menu .btn,
  .yachay-main-nav .nav-actions-mobile .user-menu .btn {
    width: 100% !important;
  }

  .header-search {
    display: none;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding: 100px 0 var(--spacing-3xl);
  }

  .hero-container {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .hero-description {
    font-size: var(--text-base);
  }

  /* FIX ESPECÍFICO: Mantener estadísticas (500+ Libros, etc.) en horizontal */
  .hero-stats {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: var(--spacing-md);
    justify-content: center !important;
    overflow-x: auto !important;
  }

  .hero-stat {
    flex: 1 1 33.33% !important;
    min-width: 100px !important;
    text-align: center !important;
  }

  /* Ocultar hero-visual en mobile */
  .hero-visual {
    display: none;
  }

  .hero-features {
    position: relative;
    width: 100%;
    margin-left: 0;
    transform: none;
    grid-template-columns: 1fr;
    margin-top: var(--spacing-2xl);
  }

  /* .floating-card {
    display: none;
  } */

  /* Footer */
  .footer {
    padding-top: var(--spacing-2xl);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    text-align: center;
  }

  .footer-column {
    text-align: center;
  }

  .footer-brand {
    justify-content: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-links,
  .footer-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-contact li {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--spacing-md);
    text-align: center;
  }

  /* Scroll to top */
  .scroll-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
}

/* Mobile Small (max-width: 480px) */
@media (max-width: 480px) {
  /* Base */
  html {
    font-size: 13px;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  /* Typography */
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }

  /* Spacing */
  .section {
    padding: var(--spacing-xl) 0;
  }

  /* Logo */
  .logo {
    font-size: var(--text-xl);
  }

  .logo-icon {
    width: 38px;
    height: 38px;
    font-size: var(--text-lg);
  }

  /* Hero */
  .hero {
    padding: 80px 0 var(--spacing-2xl);
  }

  .hero-badge {
    font-size: var(--text-xs);
    padding: var(--spacing-xs) var(--spacing-md);
  }

  .hero-title {
    font-size: clamp(1.75rem, 7vw, 2rem);
  }

  .hero-stat-number {
    font-size: var(--text-2xl);
  }

  /* FIX ESPECÍFICO MÓVILES PEQUEÑOS INDEX: Botones más compactos pero lado a lado */
  .index-page .hero-actions {
    gap: var(--spacing-xs) !important;
  }

  .index-page .hero-actions .btn {
    flex: 1 1 48% !important;
    min-width: 100px !important;
    padding: var(--spacing-xs) var(--spacing-sm) !important;
    font-size: var(--text-sm) !important;
  }

  /* CTA buttons en móviles pequeños */
  .index-page .index-cta-buttons .btn {
    flex: 1 1 48% !important;
    min-width: 100px !important;
    padding: var(--spacing-xs) var(--spacing-sm) !important;
    font-size: var(--text-sm) !important;
  }  /* Estadísticas más compactas en móviles muy pequeños */
  .hero-stat {
    padding: var(--spacing-xs) !important;
    min-width: 80px !important;
  }  .feature-card {
    padding: var(--spacing-lg);
  }

  .feature-icon {
    width: 50px;
    height: 50px;
    font-size: var(--text-xl);
  }

  /* Footer */
  .footer-logo {
    width: 45px;
    height: 45px;
    font-size: var(--text-xl);
  }

  .footer-brand-name {
    font-size: var(--text-xl);
  }

  .social-link {
    width: 36px;
    height: 36px;
    font-size: var(--text-base);
  }

  /* Newsletter */
  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-btn {
    width: 100%;
  }
}

/* Landscape Mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 120px 0 var(--spacing-2xl);
  }

  .hero-features {
    display: none;
  }
}

/* Utility Classes for Responsive */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .show-mobile {
    display: none !important;
  }
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .scroll-top,
  .hero-features {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: var(--spacing-xl) 0;
  }
}

/* Botón de logout en móvil */
@media (max-width: 768px) {
  /* Reset logo positioning solo en móvil */
  .logo {
    position: static !important;
    left: auto !important;
  }

  .nav-actions .user-menu {
    width: 100%;
    flex-direction: column;
  }

  .nav-actions .user-menu a,
  .nav-actions .user-menu form {
    width: 100%;
  }

  .nav-actions .user-menu button {
    width: 100%;
    justify-content: center;
  }

  .nav-actions .user-menu .hide-mobile {
    display: inline !important;
  }

    /* Botones en modo oscuro */
    .dark-mode .nav .nav-actions-mobile .btn,
    .dark-mode .nav .nav-actions-mobile .user-menu-btn,
    .dark-mode .nav .nav-actions-mobile .yachay-nav-btn,
    .dark-mode .nav .nav-actions-mobile a,
    .dark-mode .yachay-main-nav .nav-actions-mobile .btn,
    .dark-mode .yachay-main-nav .nav-actions-mobile .user-menu-btn,
    .dark-mode .yachay-main-nav .nav-actions-mobile .yachay-nav-btn,
    .dark-mode .yachay-main-nav .nav-actions-mobile a,
    .dark-mode #navMenu .nav-actions-mobile .btn,
    .dark-mode #navMenu .nav-actions-mobile .user-menu-btn,
    .dark-mode #navMenu .nav-actions-mobile .yachay-nav-btn,
    .dark-mode #navMenu .nav-actions-mobile a,
    [data-theme="dark"] .nav .nav-actions-mobile .btn,
    [data-theme="dark"] .nav .nav-actions-mobile .user-menu-btn,
    [data-theme="dark"] .nav .nav-actions-mobile .yachay-nav-btn,
    [data-theme="dark"] .nav .nav-actions-mobile a,
    [data-theme="dark"] .yachay-main-nav .nav-actions-mobile .btn,
    [data-theme="dark"] .yachay-main-nav .nav-actions-mobile .user-menu-btn,
    [data-theme="dark"] .yachay-main-nav .nav-actions-mobile .yachay-nav-btn,
    [data-theme="dark"] .yachay-main-nav .nav-actions-mobile a,
    [data-theme="dark"] #navMenu .nav-actions-mobile .btn,
    [data-theme="dark"] #navMenu .nav-actions-mobile .user-menu-btn,
    [data-theme="dark"] #navMenu .nav-actions-mobile .yachay-nav-btn,
    [data-theme="dark"] #navMenu .nav-actions-mobile a {
      background: #6366f1 !important;
      border: none !important;
      color: #fff !important;
    }    .dark-mode .nav .nav-actions-mobile .btn:hover,
    .dark-mode .nav .nav-actions-mobile .user-menu-btn:hover,
    .dark-mode .nav .nav-actions-mobile .yachay-nav-btn:hover,
    .dark-mode .nav .nav-actions-mobile a:hover,
    .dark-mode .yachay-main-nav .nav-actions-mobile .btn:hover,
    .dark-mode .yachay-main-nav .nav-actions-mobile .user-menu-btn:hover,
    .dark-mode .yachay-main-nav .nav-actions-mobile .yachay-nav-btn:hover,
    .dark-mode .yachay-main-nav .nav-actions-mobile a:hover,
    .dark-mode #navMenu .nav-actions-mobile .btn:hover,
    .dark-mode #navMenu .nav-actions-mobile .user-menu-btn:hover,
    .dark-mode #navMenu .nav-actions-mobile .yachay-nav-btn:hover,
    .dark-mode #navMenu .nav-actions-mobile a:hover,
    [data-theme="dark"] .nav .nav-actions-mobile .btn:hover,
    [data-theme="dark"] .nav .nav-actions-mobile .user-menu-btn:hover,
    [data-theme="dark"] .nav .nav-actions-mobile .yachay-nav-btn:hover,
    [data-theme="dark"] .nav .nav-actions-mobile a:hover,
    [data-theme="dark"] .yachay-main-nav .nav-actions-mobile .btn:hover,
    [data-theme="dark"] .yachay-main-nav .nav-actions-mobile .user-menu-btn:hover,
    [data-theme="dark"] .yachay-main-nav .nav-actions-mobile .yachay-nav-btn:hover,
    [data-theme="dark"] .yachay-main-nav .nav-actions-mobile a:hover,
    [data-theme="dark"] #navMenu .nav-actions-mobile .btn:hover,
    [data-theme="dark"] #navMenu .nav-actions-mobile .user-menu-btn:hover,
    [data-theme="dark"] #navMenu .nav-actions-mobile .yachay-nav-btn:hover,
    [data-theme="dark"] #navMenu .nav-actions-mobile a:hover {
      background: rgba(99, 102, 241, 0.1) !important;
      color: #6366f1 !important;
      border: none !important;
    }  /* CSS para forzar actualizaciones en modo incógnito */
  .nav-actions-mobile {
    will-change: border-color, background !important;
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
  }

  /* ==========================================
     RESPONSIVIDAD ESPECÍFICA PÁGINA PRINCIPAL
     ========================================== */

  /* Secciones principales con espaciado profesional */
  .section {
    padding: var(--spacing-2xl) var(--spacing-md) !important;
  }

  /* Cards de características */
  .card {
    padding: var(--spacing-xl) !important;
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
  }



  /* CTA Section mejorado */
  section[style*="background: linear-gradient"] {
    padding: var(--spacing-3xl) var(--spacing-lg) !important;
    margin: var(--spacing-2xl) 0 !important;
    border-radius: var(--radius-xl) !important;
  }

  /* Feature cards con mejor espaciado */
  .hero-features {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: var(--spacing-lg) !important;
    margin-top: var(--spacing-2xl) !important;
  }

  .feature-card {
    padding: var(--spacing-xl) !important;
    text-align: center;
    border-radius: var(--radius-lg) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  }

  .feature-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
  }

  .feature-icon {
    margin: 0 auto var(--spacing-lg) !important;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-100), var(--secondary-100));
  }

  /* ==========================================
     ULTRA MÓVIL (< 480px) - Máxima simetría
     ========================================== */
  @media (max-width: 479px) {
    .hero-actions .btn,
    [style*="display: flex"][style*="gap"] .btn {
      flex: 1 1 100% !important;
      min-width: auto !important;
      max-width: 280px !important;
      margin: 0 auto !important;
    }

    .hero-actions,
    [style*="display: flex"][style*="gap"] {
      flex-direction: column !important;
      align-items: stretch !important;
    }

    .grid-4 {
      grid-template-columns: 1fr !important;
      gap: var(--spacing-lg) !important;
    }

    .hero-features {
      grid-template-columns: 1fr !important;
    }

    .section {
      padding: var(--spacing-xl) var(--spacing-sm) !important;
    }

    .card {
      padding: var(--spacing-lg) !important;
    }
  }

  /* Tablets y pantallas medianas */
  @media (min-width: 768px) and (max-width: 1060px) {
    .hero-actions .btn,
    [style*="display: flex"][style*="gap"] .btn {
      flex: 0 1 auto !important;
      min-width: 200px !important;
      max-width: 250px !important;
    }

    .hero-features {
      grid-template-columns: repeat(2, 1fr) !important;
    }
  }
}

/* ===================================================================
   OVERRIDE CRÍTICO PARA INDEX - SOBREESCRIBIR HERO.CSS
   =================================================================== */

/* BOTONES LADO A LADO: 767px hasta 656px */
@media (max-width: 767px) and (min-width: 656px) {
  /* SOLO INDEX: Botones lado a lado en este rango específico */
  .index-page .hero-actions {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: var(--spacing-sm) !important;
    justify-content: center !important;
    width: 100%;
  }

  .index-page .hero-actions .btn {
    flex: 1 1 50% !important;
    min-width: 120px !important;
    max-width: none !important;
    justify-content: center;
  }

  /* CTA Section botones lado a lado */
  .index-page .index-cta-buttons {
    flex-wrap: nowrap !important;
    gap: var(--spacing-md) !important;
  }

  .index-page .index-cta-buttons .btn {
    flex: 1 1 50% !important;
    min-width: 120px !important;
    max-width: none !important;
  }

  /* OVERRIDE CRÍTICO - Mayor especificidad que hero.css */
  .index-page .hero .hero-content .hero-actions {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: var(--spacing-sm) !important;
    justify-content: center !important;
    width: 100% !important;
  }

  .index-page .hero .hero-content .hero-actions .btn {
    flex: 1 1 50% !important;
    width: auto !important;
    max-width: none !important;
    min-width: 120px !important;
    justify-content: center !important;
    margin: 0 !important;
  }
}

/* SOLO PARA INDEX: Reducir drásticamente el espacio hero */
body .index-page .hero {
  min-height: auto !important;
  padding-top: 40px !important;
  padding-bottom: 20px !important;
}

/* SOLO PARA INDEX: Eliminar completamente el hero-visual problemático en tablets Y su espacio */
@media (max-width: 1060px) and (min-width: 768px) {
  body .index-page .hero-visual,
  .index-page .hero-visual {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Cambiar hero-container a layout de una columna sin el visual */
  body .index-page .hero-container,
  .index-page .hero-container {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
}

/* SOLO PARA INDEX: En desktop mantener el layout original con floating cards */
@media (min-width: 1061px) {
  body .index-page .hero-visual {
    display: flex !important;
    min-height: 500px !important;
  }

  body .index-page .hero-container {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* BOTONES UNO DEBAJO DEL OTRO: ≤655px */
@media (max-width: 655px) {
  /* SOLO INDEX: Espacio más compacto en móviles */
  body .index-page .hero {
    padding-top: 70px !important;
    padding-bottom: 40px !important;
  }

  /* Eliminar espacio en blanco izquierdo SOLO en index */
  .index-page {
    margin-left: 0 !important;
  }

  .index-page .container:not(.header-container) {
    margin-left: 0 !important;
    padding-left: var(--spacing-md) !important;
    padding-right: var(--spacing-md) !important;
  }

  /* Hero actions: cambiar a columna (uno debajo del otro) */
  .index-page .hero-actions {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: var(--spacing-md) !important;
    align-items: center !important;
    width: 100%;
  }

  .index-page .hero-actions .btn {
    flex: none !important;
    width: 100% !important;
    max-width: 280px !important;
    min-width: auto !important;
    justify-content: center;
    margin: 0 auto;
  }

  /* CTA buttons: también uno debajo del otro */
  .index-page .index-cta-buttons {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: var(--spacing-md) !important;
    align-items: center !important;
  }

  .index-page .index-cta-buttons .btn {
    flex: none !important;
    width: 100% !important;
    max-width: 280px !important;
    min-width: auto !important;
  }

  /* Override crítico con mayor especificidad */
  .index-page .hero .hero-content .hero-actions {
    flex-direction: column !important;
    align-items: center !important;
    gap: var(--spacing-md) !important;
  }

  .index-page .hero .hero-content .hero-actions .btn {
    flex: none !important;
    width: 100% !important;
    max-width: 280px !important;
    min-width: auto !important;
    margin: 0 auto !important;
  }

  /* Estadísticas: mantener horizontal pero más compactas */
  .index-page .hero-stats {
    gap: var(--spacing-sm) !important;
  }

  .index-page .hero-stat {
    min-width: 80px !important;
    padding: var(--spacing-xs) !important;
  }
}

@media (max-width: 480px) {
  /* SOLO INDEX: Pantallas muy pequeñas */
  body .index-page .hero {
    padding-top: 60px !important;
    padding-bottom: 30px !important;
  }

  /* Eliminar completamente espacio en blanco izquierdo SOLO en index */
  .index-page {
    margin-left: 0 !important;
  }

  .index-page .container:not(.header-container) {
    margin-left: 0 !important;
    padding-left: var(--spacing-sm) !important;
    padding-right: var(--spacing-sm) !important;
  }

  /* Botones más compactos verticalmente */
  .index-page .hero-actions .btn {
    padding: var(--spacing-sm) var(--spacing-lg) !important;
    font-size: var(--text-sm) !important;
    max-width: 260px !important;
  }

  .index-page .index-cta-buttons .btn {
    padding: var(--spacing-sm) var(--spacing-lg) !important;
    font-size: var(--text-sm) !important;
    max-width: 260px !important;
  }

  .index-page .hero .hero-content .hero-actions .btn {
    padding: var(--spacing-sm) var(--spacing-lg) !important;
    font-size: var(--text-sm) !important;
    max-width: 260px !important;
  }
}
