html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --color-primario: #F3363D;
    --color-secundario: #FFCDB0;
    --titulos: 4em;
    --subtitulos: 1.8em;
    --textos: 1.3em;
    --textosNavMenu: 1em; /* Reducido de 1.2em */
    --shadow: -4px 5px 1px rgba(0, 0, 0, 0.5);
}

/* Ajuste de fuentes para Tabletas */
@media (max-width: 1024px) {
    :root {
        --titulos: 3em;
        --subtitulos: 1.5em;
        --textos: 1.2em;
        --textosNavMenu: 1.1em;
    }
}

/* Ajuste de fuentes para Móviles */
@media (max-width: 480px) {
    :root {
        --titulos: 2.2em;
        --subtitulos: 1.3em;
        --textos: 1.1em;
        --textosNavMenu: 1em;
    }
}

/* --- ANIMACIÓN ARAÑA SCROLL --- */
#efectoArana {
    position: fixed;
    right: 10px;
    top: 0;
    z-index: 5000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#hiloArana {
    width: 1px;
    /* Hilo más fino */
    background-color: rgba(255, 255, 255, 0.3);
    height: 50px;
    position: absolute;
    top: 0;
    z-index: 4999;
}

#imgTelarana {
    width: 120px;
    /* Un poco más pequeña */
    height: auto;
    opacity: 0.7;
    /* Más sutil */
    filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.2));
}

#imgArana {
    width: 45px;
    /* Un poco más pequeña */
    height: auto;
    position: absolute;
    top: 30px;
    filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.5));
}

/* ------------------------------ */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

body {
    background-color: var(--color-secundario);
}

nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background-color: var(--color-primario);
}

#logoBox {
    display: flex;
    justify-content: start;
    padding: 0.8em 0 0.8em 4em; /* Reducido un 20% */
}

#logoBox a {
    text-decoration: none;
    display: flex;
    transition: transform 0.3s ease;
}

#logoBox a:hover {
    transform: scale(1.05);
}

#logoBox img {
    width: 60px; /* Reducido de 75px */
    height: 60px; /* Reducido de 75px */
    object-fit: cover;
}

#navMenuBox {
    display: flex;
    list-style: none;
    color: var(--color-secundario);
}

#navMenuBox ul {
    padding: 24px; /* Reducido de 30px */
    justify-content: right;
    display: flex;
    gap: 1.6em; /* Reducido de 2em */
    flex-direction: row;
}


#navMenuBox li {
    list-style: none;
    display: flex;
    flex-direction: row;
    gap: 3em;
}

#navMenuBox li a {
    color: var(--color-secundario);
    text-decoration: none;
    font-size: var(--textosNavMenu);
    text-align: center;
    font-weight: bold;
    margin-bottom: 0.2em;
}


#caruselBox {
    background-color: black;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    height: 100vh;
}

.caruselItemsBox {
    display: flex;
    width: 600%;
    height: 100%;
}

.slider {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;

}


#quienesSomosBox {
    background-color: var(--color-primario);
    color: var(--color-secundario);
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 2em;
    margin: 6em auto;
    width: 90%;
    max-width: 1200px;
    padding: 3em;
    min-height: 80vh;
    border-radius: 3em;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.4);


}

.quienesTitulo {
    text-align: center;
    font-weight: bold;
    font-size: var(--titulos);
    text-shadow: var(--shadow);
    margin-bottom: 0.2em;
}

.quienesTexto {
    text-align: center;
    font-size: var(--textos);
    font-weight: lighter;
}

.equipoTitulo {
    text-align: center;
    font-weight: bold;
    font-size: var(--titulos);
    text-shadow: var(--shadow);
    margin-bottom: 0.2em;
}

.equipoTexto {
    text-align: center;
    font-size: var(--textos);
    font-weight: lighter;

}



#bodyProyectosBox {
    background-color: var(--color-primario);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

#proyectosBox {
    background-color: var(--color-secundario);
    color: var(--color-primario);
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 2em;
    margin: 6em auto;
    width: 90%;
    max-width: 1200px;
    padding: 3em;
    border-radius: 3em;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.4);
}

#proyectosBox h1 {
    text-align: center;
    justify-content: start;
    align-items: start;
    font-weight: bold;
    font-size: var(--titulos);
    text-shadow: var(--shadow);
    margin-bottom: 0.2em;
}

/* EFECTO DE GALERÍA DIAGONAL */
.galeriaProyectos {
    display: flex;
    width: 100%;
    height: 400px;
    overflow: hidden;
    /* Esto asegura que las esquinas inclinadas no se salgan del borde principal */
    border-radius: 15px;
    /* Bordes redondeados generales */
    margin-top: 2em;
}

.imgProyectos {
    flex: 1;
    transform: skewX(-15deg);
    margin: 0 -10px;
    overflow: hidden;
    border-left: 4px solid var(--color-secundario);
}

.imgProyectos.item1 {
    border-left: none;
}

.imagenFondo {
    width: 150%;
    height: 100%;
    transform: skewX(15deg);
    margin-left: -25%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.item1 .imagenFondo {
    background-image: url(img/Fotografias/1);
}

.item2 .imagenFondo {
    background-image: url(img/Fotografias/2)
}

.item3 .imagenFondo {
    background-image: url(img/Fotografias/3)
}

.item4 .imagenFondo {
    background-image: url(img/Fotografias/4)
}

/* Un pequeño efecto hover para que se vea premium */
.imgProyectos:hover .imagenFondo {
    transform: skewX(15deg) scale(1.1);
    /* Se acerca un poco al poner el mouse */
}


#serviciosContactoBox {
    display: flex;
    flex-direction: row;
    justify-content: center;
    background-color: var(--color-primario);
    padding: 4em 2em;
    min-height: 100vh;
    flex-wrap: wrap;

}


#serviciosBox {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 4em;
}

#contactoBox {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: 4em;
    padding-right: 130px;
    /* Espacio reservado para que pase la araña */
}

.separadorVertical {
    width: 3px;
    background-color: white;
    border-radius: 2px;
}

.seccionTitulo {
    font-size: var(--titulos);
    font-weight: bold;
    text-shadow: var(--shadow);
    color: var(--color-secundario);
    margin-bottom: 0.8em;
    text-align: center;
}

.servicioCard {
    background-color: var(--color-secundario);
    color: var(--color-primario);
    border-radius: 25px;
    padding: 1.5em;
    margin-bottom: 1.2em;
    width: 100%;
    max-width: 450px;
    text-align: center;
    box-shadow: -4px 5px 10px rgba(0, 0, 0, 0.4);
}

.servicioCard h2 {
    font-size: var(--subtitulos);
    font-weight: 900;
}

.servicioCard p {
    font-size: var(--textos);
    font-weight: 500;
}

.contactoCard h2 {
    margin-top: 0.8em;
    margin-bottom: 0.2em;
    font-size: var(--subtitulos);
}

.contactoCard p {
    margin-bottom: 1em;
}

.contactoCard a {
    color: var(--color-primario);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.contactoCard a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* --- ESTILOS MENÚ HAMBURGUESA --- */
#menuHamburguesa {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
    margin: auto 2em;
}

#menuHamburguesa span {
    width: 100%;
    height: 3px;
    background-color: var(--color-secundario);
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Animación Hamburguesa a X */
#menuHamburguesa.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

#menuHamburguesa.open span:nth-child(2) {
    opacity: 0;
}

#menuHamburguesa.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* RESPONSIVIDAD PARA MÓVILES */
@media (max-width: 768px) {
    nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5em 0;
    }

    #logoBox {
        padding-left: 1em;
    }

    #menuHamburguesa {
        display: flex;
    }

    #navMenuBox {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 70%;
        background-color: var(--color-primario);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        z-index: 1000;
        box-shadow: -10px 0 20px rgba(0, 0, 0, 0.3);
    }

    #navMenuBox.open {
        transform: translateX(0);
    }

    #navMenuBox ul {
        flex-direction: column;
        gap: 5vh; /* Espaciado fluido basado en el alto de la pantalla */
        text-align: center;
        padding: 0;
    }

    #navMenuBox ul li a {
        font-size: clamp(1.5rem, 6vw, 2.5rem); /* Texto fluido que se adapta al ancho */
        letter-spacing: 2px;
        transition: all 0.3s ease;
        display: block;
        width: 100%;
    }

    #navMenuBox ul li a:active {
        color: white;
        transform: scale(1.1);
    }

    #navMenuBox li style {
        display: none;
        /* Ocultamos el espacio vacío de la araña en móvil */
    }

    /* Ocultar el li vacío en móvil */
    #navMenuBox ul li:last-child {
        display: none;
    }

    #serviciosContactoBox {
        flex-direction: column;
        padding: 3em 1.5em;
    }

    #serviciosBox {
        padding-right: 0;
        margin-bottom: 2em;
        width: 100%;
    }

    #contactoBox {
        padding-left: 0;
        margin-top: 2em;
        width: 100%;
        padding-right: 0;
        /* Quitamos el padding de la araña en móvil */
    }

    .separadorVertical {
        width: 80%;
        height: 3px;
        margin: 2em auto;
    }

    /* GALERÍA DE PROYECTOS EN MÓVIL: APILADO HORIZONTAL */
    .galeriaProyectos {
        display: flex;
        flex-direction: column;
        height: auto;
        gap: 20px;
        overflow: visible;
    }

    .imgProyectos {
        flex: none;
        width: 100%;
        height: 250px;
        transform: none;
        margin: 0;
        border-left: none;
        border-radius: 20px;
    }

    .imagenFondo {
        transform: none;
        width: 100%;
        height: 100%;
        margin-left: 0;
    }

    /* Animación de selección tipo "POP" para móvil */
    .imgProyectos:active .imagenFondo,
    .imgProyectos:hover .imagenFondo {
        transform: none; /* Seguimos sin hacer zoom a la foto interna */
        filter: none; /* Quitamos el brillo */
    }

    .imgProyectos:active {
        transform: scale(1.05); /* Efecto Pop: el cuadro crece ligeramente */
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
        z-index: 10; /* Se pone por encima de los demás al pulsar */
        transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
}