/* 📱 MOBILE FIRST - Estilos base para mobile */
@media (max-width: 768px) {

  /* Notificaciones FORM */
  .notification {
    right: 15px !important;
    left: 15px !important;
    max-width: none !important;
    font-size: 0.9rem;
  }

  /* Indicador visual de carga en el formulario */
  #contactForm.sending .btn-primary {
    position: relative;
    overflow: hidden;
  }

  #contactForm.sending .btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading-shimmer 1.5s infinite;
  }

  @keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
  }

  .main-flex-container{
    min-height: auto;
    height: auto !important;
    align-items: stretch; 
    flex-direction: column;
    text-align: center;
    gap: 1.5rem; 
    margin: 0;
    padding: calc(var(--header-height) + 0rem) 1rem 2rem !important;
  }

   /* ESTILO PARA EL TEXTO DE BIENVENIDA */
  .scramble-text { /* Reemplaza .scramble-text con la clase de tu h1 */
    font-size: 8vw; 
  }

  /* foto perfil */
  .profile-picture {
    width: 255px; /* Tamaño del contenedor */
    max-width: 80%; /* Asegura que no se salga de la pantalla */
    height: 285px; /* Usa la misma altura para que sea cuadrado */
    margin: 0 auto 15px auto; /* Centra el contenedor y le da margen inferior */
    order: 1;
    clip-path: none !important;
  }

  /* ocultar descripcion footer */
  .footer-copyright{
    display: none !important;
  }
  
  /* Header responsive */
  header {
    height: 60px;
    padding: 0 15px;
    font-size: 1.2rem;
  }
  
  :root {
    --header-height: 60px;
  }
  
  .header-content {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .borde-logo:before,
  .borde-logo:after {
    width: 30px;
    height: 15px;
  }

  /* Elimina el highlight azul en dispositivos móviles */
  a,
  button,
  input,
  textarea {
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Navegación mobile */
  .nav-list {
    gap: 20px;
    font-size: 0.9rem;
  }
  
  /* Container responsive */
  .container {
    width: 95%;
    padding: 0 10px;
  }
  
  .descripcion {
    order: 2; /* Foto primero, texto después */
  }
  
  .descripcion h2 {
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 1rem;
  }
  
  .titulo-secundario {
    font-size: 1.2rem;
    display: block;
    margin-top: 0.5rem;
  }
  
  /* Botones responsive */
  .botones-home {
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
  }
  
  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 250px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    margin: 0 auto;
  }
  
  /* Sobre mí responsive */
  .sobre-mi-section {
    height: auto;
    min-height: 100vh;
    padding: 3rem 1rem;
  }
  
  .sobre-mi-section .container {
    width: 100%;
    max-width: none;
  }
  
  .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
  
  .sobre-mi-texto {
    font-size: 1rem;
    line-height: 1.5;
    text-align: left;
  }
  
  /* Habilidades responsive */
  .habilidades-icons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
    overflow-x: visible;
  }
  
  .habilidad {
    min-width: 60px;
    flex: 0 0 calc(25% - 12px); /* 4 por fila en mobile */
    -webkit-tap-highlight-color: transparent;
  }
  
  .habilidad i, 
  .habilidad img {
    font-size: 40px;
    width: 40px;
    height: 40px;
  }
  
  .habilidad span {
    font-size: 0.8rem;
  }
  
  /* Proyectos responsive */
  .proyectos-section {
    padding: 2rem 1rem;
    gap: 4rem;
  }
  
  .proyectos-section .section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
  
  .card {
    flex-direction: column;
    width: 100%;
    gap: 1.5rem;
    text-align: center;
  }
  
  .card:nth-child(even) {
    flex-direction: column; /* Desactiva la inversión en mobile */
  }
  
  .card img {
    width: 100%;
    max-width: 100%;
    height: auto;
  }
  
  .card-content {
    width: 100%;
  }
  
  .card-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }
  
  .card-content p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }
  
  /* Contacto responsive */
  .contacto-section {
    height: auto;
    min-height: 100vh;
    padding: 3rem 1rem;
  }
  
  .contacto-section .container {
    width: 100%;
    max-width: none;
  }
  
  #contactForm {
    padding: 1.5rem;
    gap: 1rem;
  }
  
  .form-group input,
  .form-group textarea {
    padding: 0.8rem 1rem;
    font-size: 1rem;
  }
  
  .form-group input#nombre,
  .form-group input#email,
  .form-group textarea#mensaje {
    padding-left: 1rem; /* Restaura el padding a un valor normal */
    background-image: none !important; /* Elimina la imagen de fondo */
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 18px 18px;
  }

    /* Solución para ocultar íconos de autocompletado nativos */
  input::-webkit-contacts-auto-fill-button {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    right: 0;
  }
  
  /* Navegación scroll responsive */
  .scroll-nav {
    display: none !important;
  }
  
  /* Sidebar oculto en mobile */
  .sidebar-info {
    display: none;
  }
  
  /* Ajustes de foto perfil */
  .foto-perfil {
    width: 100%; /* La imagen ocupa el 100% del contenedor */
    height: 100%;
    object-fit: cover; /* Recorta la imagen para que se ajuste sin distorsionarse */
    object-position: center; /* Centra la imagen dentro del recorte */
  }
  
  /* Fix para formulario mobile */
  .form-group label {
    font-size: 1rem;
  }
  
  #contactForm button.btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    align-self: stretch;
  }

    .site-footer {
    padding: 2rem 0 1rem;
  }
  
  .footer-container {
    padding: 0 1rem;
  }
  
  /* CAMBIO PRINCIPAL: Layout en columna única */
  .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
  }
  
  /* Logo primero */
  .footer-logo {
    order: 1;
    text-align: center;
  }
  
  .footer-logo h2 {
    font-size: 1.5rem;
  }
  
  .footer-logo-text:before,
  .footer-logo-text:after {
    width: 35px;
    height: 20px;
  }
  
  /* Iconos sociales segundo */
  .footer-social {
    order: 2;
    text-align: center;
  }
  
  .footer-social h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
  }
  
  /* ASEGURAR que los iconos se muestren */
  .footer-social-icons {
    display: flex !important;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
  }
  
  .footer-social-icons a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
  
  /* Contacto tercero */
  .footer-info {
    order: 3;
    text-align: center;
  }
  
  .footer-info h3 {
    justify-content: center;
    font-size: 1.1rem;
  }
  
  .footer-contact {
    align-items: center;
  }
  
  .footer-contact a {
    justify-content: center;
    font-size: 1rem;
  }
  
  /* Bottom section responsive */
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }
}

/* 📱 MOBILE PEQUEÑO (hasta 480px) */
@media (max-width: 480px) {
  /* Ajuste animacion para pantallas muy pequeñas */
  .scramble-text { 
    font-size: 10vw;
  }
  
  /* Ajustes para pantallas muy pequeñas */
  .nav-list {
    gap: 15px;
    font-size: 0.8rem;
  }
  
  .logo {
    font-size: 1rem;
  }
  
  .descripcion h2 {
    font-size: 1.5rem;
  }
  
  .titulo-secundario {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .card-content h3 {
    font-size: 1.5rem;
  }
  
  .habilidad {
    flex: 0 0 calc(33.33% - 12px); /* 3 por fila en pantallas muy pequeñas */
  }
  
  .habilidades-icons {
    gap: 12px;
  }
  
  /* Espaciado general reducido */
  .sobre-mi-section,
  .contacto-section {
    padding: 2rem 0.5rem;
  }
  
  .proyectos-section {
    padding: 2rem 0.5rem;
    gap: 3rem;
  }
  
  #contactForm {
    padding: 1rem;
  }

    .site-footer {
    padding: 1.5rem 0 1rem;
  }
  
  .footer-content {
    gap: 1.8rem;
  }
  
  /* Iconos más grandes en mobile pequeño */
  .footer-social-icons {
    gap: 1.2rem;
  }
  
  .footer-social-icons a {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
  
  .footer-logo h2 {
    font-size: 1.3rem;
  }
  
  .footer-tagline,
  .footer-contact a {
    font-size: 0.9rem;
  }
  
  .footer-bottom {
    font-size: 0.8rem;
    gap: 0.6rem;
  }
  
  /* Texto del copyright más pequeño en pantallas muy pequeñas */
  .footer-credits {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* 💻 TABLET (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  
  .main-flex-container {
    gap: 3rem;
    padding: 2rem;
  }
  
  .descripcion h2 {
    font-size: 2.2rem;
  }
  
  .section-title {
    font-size: 2.5rem;
  }
  
  .card {
    gap: 3rem;
    width: 95%;
  }
  
  .card-content h3 {
    font-size: 2rem;
  }
  
  .habilidades-icons {
    gap: 20px;
  }
  
  .sobre-mi-section,
  .contacto-section {
    padding: 4rem 2rem;
  }
}

/* 🖥️ DESKTOP (1025px+) - Mantiene estilos originales */
@media (min-width: 1025px) {
  
  /* Aquí mantienes los estilos originales de desktop */
  .main-flex-container {
    flex-direction: row;
  }
  
  .card {
    flex-direction: row;
  }
  
  .card:nth-child(even) {
    flex-direction: row-reverse;
  }
  
  .sidebar-info {
    display: flex;
  }
}

/* ===== UTILIDADES RESPONSIVE ===== */

/* Ocultar/mostrar elementos según el dispositivo */
.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

@media (min-width: 769px) {
  .mobile-only {
    display: none;
  }
  
  .desktop-only {
    display: block;
  }
}

/* ===== RESPONSIVE PARA EL MENÚ ===== */
@media (max-width: 768px) {
  /* Fix para scroll suave en mobile */
    html {
    scroll-behavior: smooth;
  }
  
  section[id] {
    scroll-margin-top: 60px;
  }
  
  /* Ocultar navegación desktop en mobile */
  .nav-desktop {
    display: none;
  }

  /* Mostrar menú hamburguesa en mobile */
  .hamburger-menu {
    display: block;
  }

  /* Ajustar header para mobile */
  header {

    backdrop-filter: blur(10px);
  }

  .hamburger-icon {
    width: 25px;
    height: 18px;
  }

  .hamburger-icon span:nth-child(2) {
    top: 7px;
  }

  .hamburger-icon span:nth-child(3) {
    top: 14px;
  }

  .hamburger-btn.open .hamburger-icon span:nth-child(1) {
    top: 7px;
  }

  .hamburger-btn.open .hamburger-icon span:nth-child(3) {
    top: 7px;
  }

  .mobile-nav-list a {
    font-size: 1.8rem;
  }

  .hamburger-btn.open {
    width: 40px;
    height: 40px;
  }
  
  .hamburger-btn.open .hamburger-icon span {
    height: 3px;
  }
}

@media (max-width: 480px) {
  .mobile-nav-list a {
    font-size: 1.5rem;
  }

  .mobile-nav-list li {
    margin: 1.5rem 0;
  }

  .hamburger-icon {
    width: 22px;
    height: 16px;
  }

  .hamburger-icon span:nth-child(2) {
    top: 6px;
  }

  .hamburger-icon span:nth-child(3) {
    top: 12px;
  }

  .hamburger-btn.open .hamburger-icon span:nth-child(1) {
    top: 6px;
  }

  .hamburger-btn.open .hamburger-icon span:nth-child(3) {
    top: 6px;
  }
}

/* ===== FIX NAVEGACIÓN MOBILE - AGREGAR ESTE CSS ===== */

/* Ocultar la navegación original en mobile */
@media (max-width: 768px) {
  
  /* Ocultar completamente la navegación original */
  .nav,
  .nav-list,
  header .nav,
  header .nav-list {
    display: none !important;
  }
  
  /* Asegurar que solo se muestre el hamburger menu */
  .hamburger-menu {
    display: block !important;
  }
  
  /* Ajustar el header para que solo tenga logo y hamburguesa */
  .header-content {
    justify-content: space-between;
    align-items: center;
  }
  
  /* Si tienes una clase específica para la nav, también ocultarla */
  .site-header .nav,
  .site-header nav:not(.mobile-nav) {
    display: none !important;
  }
}

/* En desktop, asegurar que la nav original esté visible y el hamburger oculto */
@media (min-width: 769px) {
  
  .hamburger-menu {
    display: none !important;
  }
  
  .nav,
  .nav-list,
  .site-header .nav {
    display: flex !important;
  }
  
  /* Ocultar overlay mobile en desktop */
  .mobile-nav-overlay {
    display: none !important;
  }
}