
@media  (max-width: 767px) {

    body {
        overflow-x: hidden;
    }

    header {
        width: 100%;
    }
    
   
    .abrir-menu, .cerrar-menu {
        display: block;
        border: none;
        font-size: 2rem;
        font-weight: 900;
        background-color: transparent;
        color: #332E2E; 
    }
    
    
    .nav {
        opacity: 0;
        visibility: hidden;
        background-color: whitesmoke;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        z-index: 2;
        top: 0;
        right: 0;
        bottom: 0;
        gap: 3rem;
        position: fixed;
        height: 100%;
        width: 100%;
      
        
        padding: 2rem;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        transition: opacity 0.3s ease, visibility 0.3s ease;
        -webkit-transition: opacity 0.3s ease, visibility 0.3s ease;
        -moz-transition: opacity 0.3s ease, visibility 0.3s ease;
        -ms-transition: opacity 0.3s ease, visibility 0.3s ease;
        -o-transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
   
    .nav li a {
        color: #333;
        text-decoration: none;
        font-weight: 600; 
        transition: color 0.3s ease; 
        
    }
    
   
    .nav.visible {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: flex-end; 
        gap: 3rem;
    }
    
    
    .nav li a:hover {
        font-weight: 800; 
    }


    /*HERO*/

    main {
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
        justify-content: center;
        margin: 2rem auto;
        width: 100%;
        max-width: 500px;
        height: auto;
        color: #332E2E;
        box-sizing: border-box;
    }

    #home {
        padding: 1rem;
        margin: 1rem auto;
        gap: 1;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .TextHero {
        text-align: start;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0;
    }

    #home .TextHero .hero-name {
        font-size: 2rem !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100%;
        height: auto;
        margin-bottom: 20px;
        white-space: nowrap;
        overflow: visible;
    }

    .highlight-text {
        padding: 0 0.2em;
        font-size: inherit;
    }

    #home .ImgHero img {
        max-width: 300px;
        padding-left: 1rem;
        padding-right: 0;
    }

    .TextHero h2 {
        font-size: 1.1rem !important;
        white-space: normal;
        margin-top: 0.6rem;
        margin-bottom: 0.9rem;
        line-height: 1.35;
        word-wrap: break-word;
    }

    .TextHero .hero-title-line {
        display: block;
    }

    .TextHero .hero-title-role {
        margin-bottom: 0.15rem;
    }

    .TextHero .hero-title-spec {
        opacity: 0.9;
    }

    .TextHero h2 .highlight-text {
        font-size: inherit !important;
    }

    .TextHero p {
        font-size: 15px;
        word-wrap: break-word;
    }

   

    .scroll-indicator {
        display: none;
    }

    #home .buttonCV{
        width: 100%;
        font-size: 15px;
        padding: 0.6em 1.5em;
        max-width: 10rem;
        
       
    }
    #home button {
        width: 100%;
        font-size: 15px;
        padding: 0.6em 1.5em;
        max-width: 8rem;
    }
    
    #home .ImgHero {
        max-width: 400px;
        flex: 0;
    }

    #about {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        width: 100%;
        height: auto;
        max-width: 350px;
        margin: 4rem auto;
        gap: 3rem;
    }

    #about .titleIntereses h3 {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1rem;
    }

    #SectionHabilidades, #SectionHabilidadesBack {
        padding: 10px;
        margin-bottom: 2rem;
    }

    #SectionHabilidade #SectionHabilidadesBack .TituloHabilidades h2 {
        margin-bottom: 2rem;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .LogosHabilidades {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 10px;
        justify-items: center;
    }

    .LogosHabilidades img {
        max-width: 60px;
        height: auto;
    }

    .LogoGrandes img {
        max-width: 60px !important; 
    }
    

    #FormacionAcademica {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: start;
        flex-direction: column;
        width: 100%;
        height: auto;
        max-width: 100%;
        margin: 3rem auto;
        padding: 0 1rem;
        gap: 0;
        background-image: none;
    }

    #FormacionAcademica h2 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
        text-align: left;
        padding-left: 0;
    }

    #FormacionAcademica .formacion-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #FormacionAcademica .formacion-card {
        padding: 1.4rem 1.2rem;
    }

    #FormacionAcademica .formacion-card:hover {
        transform: none;
    }




    #SectionProyectos {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        justify-content: center;
        text-align: start;
        flex-direction: column;
        width: 100%;
        height: auto;
        max-width: 350px;
        gap: 1rem;
        line-height: 1.3;
        padding-left: 1rem;
    }

    .description{
        display: none;
    }

    .descriptionMobile{
        display: block;
    }

    .desciptionEN{
        display: none;
    }

    .descriptionMobileEN{
        display: block;
    }


    #projects {
        display: flex; /* 1. Cambiamos a flex para poner las tarjetas en fila */
        flex-direction: row; /* 2. Aseguramos la dirección horizontal */
        overflow-x: auto; /* 3. Habilitamos el scroll horizontal */
        scroll-snap-type: x mandatory; /* 4. Hacemos que el scroll se "pegue" a cada tarjeta */
        scroll-padding-left: 1rem; /* 5. Añadimos un padding inicial para el snapping */
        
        gap: 1rem;
        width: 100%;
        padding-right: 0; /* 6. Padding a la izquierda para el margen inicial */
    }

    

    .LogosProyectos {
        flex: 0 0 85%; /* 7. CADA TARJETA OCUPA EL 85% DEL ANCHO */
        scroll-snap-align: start; /* 8. El scroll se alinea al inicio de cada tarjeta */
        
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 0; /* Reseteamos el margen */
        width: auto; /* Dejamos que flex controle el ancho */
        height: auto;
    }

    .Logos{
        display: none;
    }

    #projects::-webkit-scrollbar { 
        height: 6px; 
    }
    
    #projects::-webkit-scrollbar-track { 
        background: rgba(0,0,0,0.1); 
    }

    #projects::-webkit-scrollbar-thumb {
        background: #8fc1be;
        border-radius: 3px;
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        -ms-border-radius: 3px;
        -o-border-radius: 3px;
    }

    #projects .BtnsProyectos{
        display: flex;
        justify-content: center;
        align-items: flex-start;
        gap: 1rem;
        margin-top: 1rem;
    }

    #projects .VisitarSitioBtn{
        font-size: 1rem;               
        padding: 0.75rem 1.5rem;       
        min-height: 3rem;              
    }

    /* Timeline Responsive */
    #timeline {
        max-width: 350px;
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .timeline-container h2 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .timeline {
        max-width: 300px;
    }

    .timeline::before {
        left: 30px;
        width: 3px;
    }

    .timeline-item {
        padding-left: 60px;
        margin-bottom: 2rem;
    }

    .timeline-dot {
        left: 26px;
        width: 10px;
        height: 10px;
        border: 2px solid #fff;
        box-shadow: 0 0 0 3px #8fc1be;
    }

    .timeline-content {
        padding: 1.5rem;
    }

    .timeline-content::before {
        left: -8px;
        top: 15px;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-right: 8px solid #fff;
    }

    .timeline-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .timeline-header h3 {
        font-size: 1.2rem;
    }

    .timeline-date {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }

    .timeline-company {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .timeline-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .ScreenSitios img {
        width: 100%;
        height: auto;
        max-width: 380px;
    }


    .DescriptionProyectos {
        display: flex;
        flex-direction: column;
        justify-content: start;
        align-items: flex-start;
        margin: 0 auto;
        width: 100%;
        height: auto;
        max-width: 350px;
        
    }

    .DescriptionDesktop {
        display: none;
    }
    .descriptionMobile {
        display: block;
    }

    .descriptionDesktopEN {
        display: none;
    }
    .descriptionMobileEN {
        display: block;
    }

    .TextProyectos{
        gap: 1rem;
    }

    #OtrosTrabajos {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: start;
        flex-direction: column;
        width: 100%;
        height: auto;
        max-width: 350px;
        margin: 4rem auto;
        line-height: 1.8;
    }

    #OtrosTrabajos h2 {
        padding-left: 1.5rem;
    }

    #OtrosTrabajosDescripcion {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        gap: 1rem;
        width: 100%;
        height: auto;
        max-width: 350px;
        padding: 1.5rem 1.5rem;
        
    }

    .descripcionCarrusel .liExperiencias ul li {
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        gap: 1rem;
        width: 100%;
        height: auto;
        max-width: 350px;
        
    }

    #Certificates {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: start;
        flex-direction: column;
        width: 100%;
        height: auto;
        max-width: 350px;
        margin: 4rem auto;
        gap: 3rem;
        line-height: 1.8;
    }

    #Certificates img {
        width: 100%;
        height: auto;
        max-width: 350px;
    }





    #contact {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: start;
        flex-direction: column;
        width: 100%;
        height: auto;
        max-width: 350px;
        margin: 4rem auto;
        gap: 5rem;
        line-height: 1.8;
    }

    .Contactos {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        gap: 2rem;
        width: 100%;
        height: auto;
        max-width: 350px;
        
    }

    footer {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;

    }

    footer img {
        width: 100%;
        height: auto;
        margin-top: 7rem;
    }

    #OtrosTrabajos{
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        width: 100%;
        height: auto;
        max-width: 350px;
        margin: 4rem auto;
    }

    #OtrosTrabajosDescripcion{
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        width: 100%;
        height: auto;
        max-width: 350px;
        gap: 3rem;
    }

    #OtrosTrabajosDescripcion .carrusel {
        justify-content: center;
        align-items: center;
        width: 100%;
        height: auto;
        max-width: 300px;
    
    }
    
    
    
    #OtrosTrabajosDescripcion .carousel-inner img{
        justify-content: center;
        align-items: center;
        width: 100%;
        height: auto;
        max-width: 500px;
        border-radius: 10px;
    }

    .descripcionCarrusel .liExperiencias li {
        align-items: center;
        justify-content: center;
        line-height: 1.8;
        
    }
    
    



}


/* '''''''''''''''''''''''''''''''''''''''''''''''''''tablet'''''''''''''''''''''''''''''''''''''''''''''''''''''*/


@media (min-width: 768px) and (max-width: 991px) {

    header {
        width: 100%;
        
        
    }

    .abrir-menu, .cerrar-menu {
        display: block;
        border: none;
        font-size: 2rem;
        font-weight: 900;
        background-color: transparent;
        color: #332E2E; 
    }
    
    
    .nav {
        opacity: 0;
        visibility: hidden;
        background-color: whitesmoke;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        z-index: 2;
        top: 0;
        right: 0;
        bottom: 0;
        gap: 3rem;
        position: fixed;
        height: 100%;
        width: 100%;
        padding: 2rem;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        transition: opacity 0.3s ease, visibility 0.3s ease;
        -webkit-transition: opacity 0.3s ease, visibility 0.3s ease;
        -moz-transition: opacity 0.3s ease, visibility 0.3s ease;
        -ms-transition: opacity 0.3s ease, visibility 0.3s ease;
        -o-transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    /* Enlaces dentro de la barra de navegación */
    .nav li a {
        color: #333;
        text-decoration: none;
        font-weight: 600; 
        transition: color 0.3s ease; 
        
    }
    
   
    .nav.visible {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: flex-end; 
        gap: 3rem;
    }
    
    
    .nav li a:hover {
        font-weight: 800; 
    }

    .cursor-dot, .cursor-outline {
        display: none;
    }

    /* Timeline Tablet */
    #timeline {
        max-width: 800px;
        margin: 3rem auto;
        padding: 0 1.5rem;
    }

    .timeline-container h2 {
        font-size: 2rem;
        margin-bottom: 2.5rem;
    }

    .timeline {
        max-width: 600px;
    }

    .timeline::before {
        left: 40px;
        width: 3px;
    }

    .timeline-item {
        padding-left: 80px;
        margin-bottom: 2.5rem;
    }

    .timeline-dot {
        left: 36px;
        width: 11px;
        height: 11px;
        border: 2px solid #fff;
        box-shadow: 0 0 0 3px #8fc1be;
    }

    .timeline-content {
        padding: 1.8rem;
    }

    .timeline-content::before {
        left: -9px;
        top: 18px;
        border-top: 9px solid transparent;
        border-bottom: 9px solid transparent;
        border-right: 9px solid #fff;
    }

    .timeline-header h3 {
        font-size: 1.3rem;
    }

    .timeline-date {
        font-size: 0.85rem;
        padding: 0.25rem 0.7rem;
    }

    .timeline-company {
        font-size: 1.05rem;
        margin-bottom: 0.9rem;
    }

    .timeline-description {
        font-size: 0.95rem;
        line-height: 1.55;
    }

        .scroll-indicator {
            display: none;
        }
    /*HERO*/

    main {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 10rem auto;
        width: 100%;
        max-width: 1200px;
        height: auto;
        padding: 3rem;
        gap: 4rem;
        color: #332E2E;
    }
    #home{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        width: 100%;
        max-width: 350px;
        height: auto;
        margin: 2rem auto;
    }
    
    #home  .TextHero  span {
        width: 100%;
        height: auto;
        max-width: 350px;
        font-size: 10px;
    
    }

    #SectionProyectos{
        display: flex;
        justify-content: center;
        align-items: flex-start;
        width: 100%;
        max-width: 800px;
        height: auto;
        margin: 2rem auto;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    /* #SectionProyectos h2{
       margin-bottom: 1rem;
    } */

    #projects {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 800px;
        margin: 1rem auto;
    }

    .ScreenSitios img {
        max-width: 500px;
    }
       
    .DescriptionProyectos {
        display: flex;
        flex-direction: column;
        justify-content: start;
        align-items: center;
        width: 100%;
        max-width: 800px;
        height: auto;
        margin: 2rem auto;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }
    .TextProyectos p {
        width: 100%;
        height: auto;
        max-width: 500px;
    }

    #about {
        display: flex;
        justify-content: space-around;
        align-items: center;
        max-width: 800px;
        padding: 1rem;
        margin: 0 auto;
        margin-bottom: 3rem;
        filter: drop-shadow(4px 4px 6px rgba(0, 0, 0, 0.5));
        margin-top: 9rem;
    }

    #AboutME p {
        width: 100%;
        height: auto;
        max-width: 800px;
    }

    #contact {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 800px;
        height: auto;
        margin: 2rem auto;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1)
    }

    .Contactos {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 800px;
        height: auto;
        margin: 2rem auto;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1)
    }



    #OtrosTrabajos{
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 800px;
        margin: 2rem auto;
    }

    #OtrosTrabajosDescripcion{
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: auto;
        max-width: 850px;
        margin: 2rem auto;
        gap: 3rem;
    }

    #OtrosTrabajosDescripcion .carrusel {
        justify-content: center;
        align-items: center;
        width: 100%;
        height: auto;
        max-width: 850px;
    
    }
    
    
    
    #OtrosTrabajosDescripcion .carousel-inner img{
        justify-content: center;
        align-items: center;
        width: 100%;
        height: auto;
        max-width: 500px;
        border-radius: 10px;
    }

    .descripcionCarrusel .liExperiencias li {
        align-items: center;
        justify-content: center;
        line-height: 1.8;
        
    }
}

/* Ocultar el botón "Cargar más proyectos" en mobile y tablet */
@media (max-width: 991px) {
  #btnCargarMasProyectos {
    display: none !important;
  }
}

/* ====================================
   DARK MODE RESPONSIVE STYLES
   ==================================== */

/* Mobile Dark Mode Styles */
@media (max-width: 767px) {
  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-direction: row;
  }

  .dark-mode-btn {
    padding: 0.5em 0.8em;
    font-size: 16px;
  }

  .dark-mode-btn i {
    font-size: 1rem;
  }

  /* Dark mode mobile nav */
  body.dark-mode .nav {
    background-color: #1a1a1a;
  }

  body.dark-mode .nav-list li a {
    color: #ffffff;
  }

  body.dark-mode .abrir-menu,
  body.dark-mode .cerrar-menu {
    color: #ffffff;
  }
}

/* Tablet Dark Mode Styles */
@media (min-width: 768px) and (max-width: 991px) {
  .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .dark-mode-btn {
    padding: 0.6em 0.9em;
    font-size: 17px;
  }

  /* Dark mode tablet nav */
  body.dark-mode .nav {
    background-color: #1a1a1a;
  }

  body.dark-mode .nav-list li a {
    color: #ffffff;
  }
}