:root {
    --gap: 1.25rem;
    --speed: 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --closed: 5rem;
    --open: 30rem;
    --accent: #2e7d32;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.head {
    width: 100%;
    max-width: 1400px;
    /* Escalado de 1000px a 1400px */
    margin: 0 auto;
    padding: 60px 24px 24px 24px;
    /* Padding alineado */
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    box-sizing: border-box;
}

.head h2 {
    font: 400 1.5rem/1.2 Inter, sans-serif;
    color: #020202;
}

@media (min-width: 1024px) {
    .head h2 {
        font-size: 2.25rem;
    }
}

.workflow-wrapper {
    width: calc(100% - 30px);
    /* Ajustamos el ancho para dejar espacio */
    max-width: 1360px;
    /* Reducimos un poco el max-width para compensar los márgenes */
    margin: 50px;
    /* Esto centra automáticamente la sección horizontalmente */
    height: 600px;
    min-height: 550px;
    background: linear-gradient(160deg, #0d3b66 0%, #021424 60%, #021424 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    box-sizing: border-box;

    /* APLICAMOS LA MÁSCARA AQUÍ PARA UNIFICAR TODO */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 600' preserveAspectRatio='none'%3E%3Cpath d='M0,40 Q0,0,40,0 L1360,0 Q1400,0,1400,40 L1400,560 Q1400,600,1360,600 L40,600 Q0,600,0,560 Z' fill='%23000'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1400 600' preserveAspectRatio='none'%3E%3Cpath d='M0,40 Q0,0,40,0 L1360,0 Q1400,0,1400,40 L1400,560 Q1400,600,1360,600 L40,600 Q0,600,0,560 Z' fill='%23000'/%3E%3C/svg%3E");

    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.workflow-section {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 24px;
    align-items: center;
}

.info-sidebar {
    padding-inline: 20px;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-sidebar__overline {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffca45;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* .info-sidebar__overline::before {
    content: '';
    width: 20px;
    height: 1.5px;
    background: #ffca45;
    flex-shrink: 0;
} */

.info-sidebar__title {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin: 0;
}

.info-sidebar__body {
    font-size: 15px;
    line-height: 1.4;
    color: #b0b0b0;
    margin: 0;
}

/* mini stats */
.info-sidebar__stats {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 1px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.info-sidebar__stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-sidebar__stat-num {
    font-size: 20px;
    font-weight: 800;
    color: #FFF;
    line-height: 1;
    letter-spacing: -0.02em;
}

.info-sidebar__stat-label {
    font-size: 10px;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.info-sidebar__stat-divider {
    width: 1px;
    height: 32px;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Responsive: Cuando la pantalla sea pequeña, apilar columnas */
@media (max-width: 1024px) {
    .workflow-section {
        grid-template-columns: 1fr;
    }

    .info-sidebar {
        text-align: center;
        padding-right: 0;
    }
}

.nav-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #020202;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.nav-btn:hover {
    background: var(--accent);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.full-width-slider-section {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 40px 0;
    /* Padding vertical para aire */
    background: transparent;
    /* O el color que desees */
}

.slider-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
}


.slider {
    width: 100%;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    /* Un pequeño margen lateral para que no pegue a los bordes en móviles */
    box-sizing: border-box;
}

.controls {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

.track {
    display: flex;
    gap: var(--gap);
    align-items: flex-start;
    overflow-x: auto;
    /* necesario para scrollTo */
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.track::-webkit-scrollbar {
    display: none;
}

.project-card {
    position: relative;
    flex: 0 0 var(--closed);
    height: 26rem;
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: flex-basis var(--speed), transform var(--speed);
}

.project-card[active] {
    flex-basis: var(--open);
    transform: translateY(-6px);
}

.project-card__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.75) saturate(75%);
    transition: filter 0.3s, transform var(--speed);
}

.project-card:hover .project-card__bg {
    filter: brightness(0.9) saturate(100%);
    transform: scale(1.06);
}

.project-card__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.7rem;
    padding: 0;
    background: linear-gradient(transparent 40%, #021424 100%);
    z-index: 2;
}

.project-card__title {
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.project-card__thumb,
.project-card__desc,
.project-card__btn {
    display: none;
}

.project-card[active] .project-card__content {
    flex-direction: row;
    align-items: center;
    padding: 1.2rem 2rem;
    gap: 1.1rem;
}

.project-card[active] .project-card__title {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 2.4rem;
}

.project-card[active] .project-card__thumb,
.project-card[active] .project-card__desc,
.project-card[active] .project-card__btn {
    display: block;
}

.project-card__thumb {
    width: 133px;
    height: 269px;
    border-radius: 0.45rem;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.project-card__desc {
    color: #ddd;
    font-size: 1rem;
    line-height: 1.4;
    max-width: 16rem;
}

.project-card__btn {
    padding: 0.55rem 1.3rem;
    border: none;
    border-radius: 9999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.project-card__btn:hover {
    background: #209fbf;
}


@media (max-width: 767px) {
    :root {
        --closed: 4rem;
        --open: 22rem;
    }

    .head {
        padding: 50px 20px 30px;
    }

    .track {
        flex-direction: column;
        scroll-snap-type: y mandatory;
        align-items: center;
        justify-content: flex-start;
        padding-bottom: 0;
    }

    .project-card {
        height: 20rem;
    }

    .project-card__title {
        font-size: 1.1rem;
        writing-mode: horizontal-tb;
        transform: none;
        text-align: center;
        padding-inline: 0.3rem;
    }

    .nav-btn {
        width: 2rem;
        height: 2rem;
        font-size: 1.2rem;
    }
}

@media (max-width: 767px) {
    :root {
        --closed: 100%;
        --open: 100%;
        --gap: 0.8rem;
    }

    .head {
        padding: 30px 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .slider {
        padding: 0 15px;
    }

    .track {
        flex-direction: column;
        scroll-snap-type: y mandatory;
        gap: 0.8rem;
        padding-bottom: 20px;
    }

    .project-card {
        height: auto;
        min-height: 80px;
        flex: 0 0 auto;
        width: 100%;
        scroll-snap-align: start;
    }

    .project-card[active] {
        min-height: 300px;
        transform: none;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }

    .project-card__content {
        flex-direction: row;
        justify-content: flex-start;
        padding: 1rem;
        align-items: center;
        gap: 1rem;
    }

    .project-card__title {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 1.2rem;
        margin-right: auto;
    }

    .project-card__thumb,
    .project-card__desc,
    .project-card__btn {
        display: none;
    }

    .project-card[active] .project-card__content {
        align-items: flex-start;
        padding: 1.5rem;
    }

    .project-card[active] .project-card__title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
        margin-top: 2rem;
    }

    .project-card[active] .project-card__thumb {
        width: 200px;
        height: 267px;
        border-radius: 0.35rem;
        margin-bottom: 1rem;
    }

    .project-card[active] .project-card__desc {
        font-size: 0.95rem;
        max-width: 100%;
        margin-bottom: 1rem;
    }

    .project-card[active] .project-card__btn {
        align-self: center;
        width: 100%;
        text-align: center;
        padding: 0.7rem;
    }

    .controls {
        width: 100%;
        justify-content: space-between;
        padding: 0 15px 20px;
    }

    .nav-btn {
        position: static;
        transform: none;
    }
}