/* Importar estilos base */
@import url('styles.css');

/* Contenedor principal de la sección historia */
.historia-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 45px;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 45px 15px;
}

.empresa-titulo{
    margin-top: 60px;
}

/* Contenedor de la imagen */
.imagen-historia {
    position: relative;
    flex: 0 0 452px;
}

.imagen-historia img {
    width: 452px;
    height: 280px;
    border-radius: 26px 0 0 0;
    object-fit: cover;
}

.imagen-historia figcaption {
    text-align: center;
    margin-top: 11px;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    color: #666;
}

.imagen-caption {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    color: #666;
}

/* Contenedor de fechas */
.fechas-container {
    flex: 0 0 550px;
    background: #FEFEFE;
    box-shadow: 0px 3px 5.8px 9.75px rgba(0, 0, 0, 0.03);
    border-radius: 45px;
    padding: 45px;
}

.timeline {
    display: flex;
    flex-direction: row; /* Asegura que los elementos estén en línea */
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 30px;
}

.timeline-block {
    width: 100%;
    height: 259px;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
    z-index: 2; /* Asegura que los bloques estén sobre la línea */
}

/* Contenedor de los números de año */
.years-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.year-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    color: #F68E2F;
    font-weight: 400;
    line-height: 59px;
    margin-bottom: 20px;
}

/* Línea divisoria */
.year-divider {
    flex-grow: 1;
    height: 1.5px;
    background-color: #F68E2F;
    margin-top: 38px;
    position: relative;
    top: -15px;
}

/* Estilo para cada descripción */
.year-description {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 15px;
    color: #333;
}

.timeline-divider {
    position: absolute;
    top: 30px; /* Alinea con los números */
    left: 50%;
    transform: translateX(-50%);
    width: 70px; /* Ancho de la línea */
    height: 2px; /* Grosor de la línea */
    background-color: #F68E2F; /* Mismo color que los números */
    flex-grow: 1;
    margin-top: 0;
 /*   position: relative;*/

}

/* Estilo específico para el texto de 2024 */
.year-description.current {
    flex: 1;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 15px;
    color: #333;
}

.year-description.current strong {
    font-weight: 800;
    font-size: 16px;
}

/* Texto de la historia */
.historia-texto {
    max-width: 858px;
    margin: 45px auto;
    padding: 0 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    text-align: center;
    font-size: 16px;
    line-height: 25px;
    color: #333;
}

/* Botón back to top modificado */
.back-to-index {
    width: 57px;
    height: 57px;
    border-radius: 50%;
    border: none;
    background: #F68E2F;
    display: none;
    display: flex !important;
    transform: rotate(-90deg);
}

.back-to-index svg {
    transform: rotate(90deg);
}

.back-to-index svg path {
    stroke: #FFFFFF;
    stroke-width: 2.8px;
}

.back-to-index:hover {
    background: #03C59D;
}

/* Responsive PC */
@media screen and (max-width: 1536px) {

    .empresa{
        width: 100%;
    }

    /* Contenedor principal de la sección historia */
       .historia-container {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 45px;
        width: 1200px;
        margin-left: 160px;
        padding: 45px 15px;
        flex-wrap: nowrap;
    }

    .empresa-titulo {
        margin-top: 130px;
        text-align: center; /* Asegura centrado del título */
        width: 100%; /* Ocupa todo el ancho disponible */
    }

    /* Contenedor de la imagen */
    .imagen-historia {
        position: relative;
        flex: 0 0 450px; /* Ancho fijo más pequeño */
        margin: 0 auto; /* Centra la imagen */
    }

    .imagen-historia img {
        width: 100%; /* Ajusta al contenedor */
        height: 250px;
        border-radius: 26px;
        object-fit: cover;
        display: block; /* Elimina espacio extra debajo de la imagen */
        margin: 0 auto; /* Centra la imagen */
    }

    .imagen-historia figcaption {
        text-align: center;
        margin-top: 11px;
        font-family: 'Montserrat', sans-serif;
        font-size: 11px;
        color: #666;
    }

    .imagen-caption {
        text-align: center;
        font-family: 'Montserrat', sans-serif;
        font-size: 12px;
        color: #666;
    }

    /* Contenedor de fechas */
    .fechas-container {
        flex: 0 0 520px;
        background: #FEFEFE;
        box-shadow: 0px 3px 5.8px 9.75px rgba(0, 0, 0, 0.03);
        border-radius: 45px;
        padding: 35px;
        position: relative;
        margin: 0 auto; /* Centra el contenedor */
    }

    /* Contenedor años */
    .timeline {
        text-align: center;
        position: relative;
    }

    /* Contenedor de los números de año */
    .years-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        position: relative;
    }

    /* Estilo para cada año */
    .year-number {
        width: 188px;
        font-family: 'Montserrat', sans-serif;
        font-size: 38px;
        color: #F68E2F;
        font-weight: 400;
        line-height: 59px;
        align-items: center;
    }

    .year-divider {
        width: 70px;
    }

    /* Estilo para cada descripción */
    .year-description {
        font-size: 12px;
    }

    /* Estilo específico para el texto de 2024 */
    .year-description.current {
        flex: 1;
        text-align: center;
        font-family: 'Montserrat', sans-serif;
        font-weight: 400;
        font-size: 16px;
        line-height: 15px;
        color: #333;
    }

    .year-description.current strong {
        font-weight: 800;
        font-size: 14px;
    }

    /* Texto de la historia */
    .historia-texto {
        font-size: 14px;
    }

    .back-to-index {
        width: 45px;
        height: 45px;
    }
}

@media screen and (max-width: 1366px) {

    /* Contenedor principal de la sección historia */
    .historia-container {
        display: flex;
        justify-content: center; /* Centra horizontalmente los elementos */
        align-items: center; /* Centra verticalmente los elementos */
        gap: 45px; /* Espacio entre los elementos */
        width: 100%;
        max-width: 1300px;
        padding: 45px 15px;
        margin: 0 auto; /* Centra el contenedor principal */
        /* Elimina flex-wrap para mantener los elementos uno al lado del otro */
        flex-wrap: nowrap;
    }

    .empresa-titulo {
        margin-top: 30px;
        margin-left: 0; /* Ajusta el margen izquierdo para centrar */
    }

    /* Contenedor de la imagen */
    .imagen-historia {
        position: relative;
        flex: 0 0 452px; /* Asegura un tamaño fijo */
    }

    .imagen-historia img {
        width: 452px;
        height: 280px;
        border-radius: 26px 0 0 0;
        object-fit: cover;
    }

    .imagen-historia figcaption {
        text-align: center;
        margin-top: 11px;
        font-family: 'Montserrat', sans-serif;
        font-size: 11px;
        color: #666;
    }

    .imagen-caption {
        text-align: center;
        font-family: 'Montserrat', sans-serif;
        font-size: 12px;
        color: #666;
    }

    /* Contenedor de fechas */
    .fechas-container {
        flex: 0 0 550px; /* Asegura un tamaño fijo */
        background: #FEFEFE;
        box-shadow: 0px 3px 5.8px 9.75px rgba(0, 0, 0, 0.03);
        border-radius: 45px;
        padding: 45px;
        position: relative;
    }

    /* Contenedor años */
    .timeline {
        text-align: center;
        position: relative;
    }

    /* Contenedor de los números de año */
    .years-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            position: relative;
    }

    .back-to-index {
        width: 45px;
        height: 45px;
    }
}

@media screen and (max-width: 1024px) {
    .historia-container {
        flex-direction: column;
    }

    .imagen-historia,
    .fechas-container {
        width: 100%;
        flex: none;
    }

    .imagen-historia img {
        width: 100%;
        height: auto;
        max-height: 300px;
    }
}


/* Responsive Tablets*/
@media screen and (max-width: 768px) {
    .fechas-container {
        padding: 15px;
        border-radius: 23px;
    }

    .year-number {
        font-size: 24px;
        width: 68px;
    }
}


/* Responsive Mobile */
@media screen and (max-width: 430px) {
    /* Contenedor principal */
    .historia-container {
        display: flex;
        justify-content: center;
        width: 100%;
        padding: 0;
    }

    /* Ocultar imagen */
    .imagen-historia {
        display: none;
    }

    .fechas-container {
        width: 350px;
        height: 570px;
        margin: 20px auto;
        padding: 30px 20px;
    }

    .timeline {
        flex-direction: column;
        gap: 60px;
    }

    .timeline-block {
        width: 100%;
        height: 200px;
    }

    .timeline-block.bajo {
        width: 100%;
        height: 200px;
        top: 100px;
    }

    /* Números de año */
    .year-number {
        font-size: 64px;
        margin-left: 80px;
        line-height: 78.66px;
        margin-bottom: 15px;
    }

    /* Remover divisor original */
    .year-divider {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: 60px;
        background-color: #019C9E;
    }

    /* Añadir flecha al final de la línea */
    .year-divider::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #019C9E;
    }

    /* Fila de descripciones */
    .descriptions-row {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 140px;
        margin-top: 20px;
    }

    /* Textos descriptivos */
    .year-description {
        font-size: 13px;
        line-height: 15.98px;
        max-width: 280px;
        margin: 0 auto;
    }

    .timeline-divider {
        width: 2px;
        height: 80px;
        top: 250px;
        background-color: #019C9E;
    }

    /* Flecha al final del divisor */
    .timeline-divider::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #019C9E;
    }

    .year-description.current {
        text-align: center;
    }

    .year-description.current strong {
        font-weight: 800;
        font-size: 13px;
    }
}

@media screen and (max-width: 428px) {
    /* Contenedor principal */
    .historia-container {
        display: flex;
        justify-content: center;
        width: 100%;
        padding: 0;
    }

    /* Ocultar imagen */
    .imagen-historia {
        display: none;
    }

    .fechas-container {
        width: 350px;
        height: 570px;
        margin: 20px auto;
        padding: 30px 20px;
    }

    .timeline {
        flex-direction: column;
        gap: 60px;
    }

    .timeline-block {
        width: 100%;
        height: 200px;
    }

    .timeline-block.bajo {
        width: 100%;
        height: 200px;
        top: 100px;
    }

    /* Números de año */
    .year-number {
        font-size: 64px;
        margin-left: 80px;
        line-height: 78.66px;
        margin-bottom: 15px;
    }

    /* Remover divisor original */
    .year-divider {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: 60px;
        background-color: #019C9E;
    }

    /* Añadir flecha al final de la línea */
    .year-divider::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #019C9E;
    }

    /* Fila de descripciones */
    .descriptions-row {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 140px;
        margin-top: 20px;
    }

    /* Textos descriptivos */
    .year-description {
        font-size: 13px;
        line-height: 15.98px;
        max-width: 280px;
        margin: 0 auto;
    }

    .timeline-divider {
        width: 2px;
        height: 80px;
        top: 250px;
        background-color: #019C9E;
    }

    /* Flecha al final del divisor */
    .timeline-divider::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #019C9E;
    }

    .year-description.current {
        text-align: center;
    }

    .year-description.current strong {
        font-weight: 800;
        font-size: 13px;
    }
}

@media screen and (max-width: 414px) {
    .empresa {
        min-height: auto; /* O un valor que se ajuste a tu contenido */
        height: fit-content;
    }
}

@media screen and (max-width: 390px) {
    .empresa {
        min-height: auto; /* O un valor que se ajuste a tu contenido */
        height: fit-content;
    }
}

@media screen and (max-width: 360px) {
    .empresa{
        min-height: auto; /* O un valor que se ajuste a tu contenido */
        height: fit-content;
    }

    /* Contenedor principal */
    .historia-container {
        display: flex;
        justify-content: center;
        width: 100%;
        height: 100%;
        padding: 0;
    }

    #la-empresa {
        margin: 20px 0 20px 0;
    }

    /* Ocultar imagen */
    .imagen-historia {
        display: none;
    }

    .fechas-container {
        width: 320px;
        height: 550px;
        margin: 20px auto;
        padding: 30px 20px;
    }

    .timeline {
        flex-direction: column;
        gap: 60px;
    }

    .timeline-block {
        width: 100%;
        height: 200px;
    }

    .timeline-block.bajo {
        width: 100%;
        height: 200px;
        top: 100px;
    }

    /* Números de año */
    .year-number {
        font-size: 54px;
        margin-left: 80px;
        line-height: 78.66px;
        margin-bottom: 15px;
    }

    /* Remover divisor original */
    .year-divider {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: 60px;
        background-color: #019C9E;
    }

    /* Añadir flecha al final de la línea */
    .year-divider::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #019C9E;
    }

    /* Fila de descripciones */
    .descriptions-row {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 140px;
        margin-top: 20px;
    }

    /* Textos descriptivos */
    .year-description {
        font-size: 13px;
        line-height: 15.98px;
        max-width: 280px;
        margin: 0 auto;
    }

    .timeline-divider {
        width: 2px;
        height: 80px;
        top: 250px;
        background-color: #019C9E;
    }

    /* Flecha al final del divisor */
    .timeline-divider::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #019C9E;
    }

    .year-description.current {
        text-align: center;
    }

    .year-description.current strong {
        font-weight: 800;
        font-size: 13px;
    }
}