:root {
    --gap: 0.75rem;
    --speed: 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --closed: 5.5rem;
    --open: calc(100% - (5 * 5.5rem) - (6 * 0.75rem) - 48px);
    --accent: #2d4f95;
}

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

/* ── WRAPPER FULL WIDTH ─────────────────────────────────── */
.workflow-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    height: 620px;
    min-height: 580px;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%232d4f95' fill-opacity='0.4' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
    position: relative;
    overflow: hidden;
    display: flex;
    box-sizing: border-box;
    -webkit-mask-image: none;
    mask-image: none;
}

.workflow-section {
    display: flex;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    align-items: stretch;
}

/* ── HEAD / CONTROLS ───────────────────────────────────── */
.head {
    width: 100%;
    margin: 0;
    padding: 20px 24px 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    box-sizing: border-box;
}

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

.nav-btn {
    width: 2.2rem;
    height: 2.2rem;
    border: none;
    border-radius: 50%;
    background: rgba(45, 79, 149, 0.15);
    color: #2d4f95;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

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

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

/* ── SLIDER ────────────────────────────────────────────── */
.slider-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.slider {
    width: 100%;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.track {
    display: flex;
    gap: var(--gap);
    align-items: stretch;
    overflow: hidden;
    /* sin scroll lateral */
    padding: 0 24px 20px;
    flex: 1;
    justify-content: center;
    /* centra el conjunto de cards */
}

/* ── CARDS ─────────────────────────────────────────────── */
.project-card {
    position: relative;
    flex: 0 0 var(--closed);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: flex-basis var(--speed), transform var(--speed);
    min-width: 0;
}

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

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

.project-card[active] .project-card__bg {
    filter: brightness(0.75) saturate(90%);
}

.project-card__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    background: linear-gradient(transparent 30%, rgba(2, 20, 36, 0.92) 100%);
    z-index: 2;
}

/* ── COLLAPSED STATE ───────────────────────────────────── */
.pc-collapsed {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.pc-acronym {
    color: #ffffff;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-transform: uppercase;
    opacity: 0.85;
}

/* ── EXPANDED STATE ────────────────────────────────────── */
.pc-expanded {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 28px 28px 24px;
    height: 100%;
    justify-content: flex-end;
    overflow: hidden;
}

.project-card[active] .pc-collapsed {
    display: none;
}

.project-card[active] .pc-expanded {
    display: flex;
}

.project-card[active] .project-card__content {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 0;
    justify-content: flex-end;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(2, 20, 36, 0.45) 35%,
            rgba(2, 20, 36, 0.95) 100%);
}

/* ── HEADER INSIDE EXPANDED ────────────────────────────── */
.pc-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pc-badge {
    background: #2d4f95;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 5px 10px;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    margin-top: 2px;
}

.pc-badge--gold {
    background: #b4935a;
}

.project-card__title {
    color: #fff;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-transform: uppercase;
}

.project-card[active] .project-card__title {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0;
}

.pc-location {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    display: block;
    margin-top: 3px;
}

.project-card__desc {
    display: none;
}

.project-card[active] .project-card__desc {
    display: block;
    font-size: 12.5px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
    max-width: 100%;
}

.project-card[active] .project-card__desc strong {
    color: #ffffff;
    font-weight: 600;
}

.pc-tag {
    display: inline-block;
    background: #d93d56;
    color: #ffffff;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 4px 9px;
    text-transform: uppercase;
    border-radius: 3px;
    align-self: flex-start;
}

/* ── DOTS ──────────────────────────────────────────────── */
.dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 10px 0 14px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(45, 79, 149, 0.2);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.dot.active {
    background: #2d4f95;
    transform: scale(1.3);
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1024px) {
    :root {
        --closed: 4.5rem;
        --open: calc(100% - (5 * 4.5rem) - (6 * 0.75rem) - 32px);
    }
}

@media (max-width: 767px) {
    :root {
        --gap: 0.75rem;
    }

    .workflow-wrapper {
        height: auto;
        min-height: auto;
    }

    .head {
        padding: 16px 16px 10px;
    }

    .track {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 0 16px 16px;
        gap: 0.75rem;
        justify-content: flex-start;
    }

    .project-card {
        flex: 0 0 auto;
        width: 100%;
        min-height: 64px;
        border-radius: 0.75rem;
    }

    .project-card[active] {
        flex-basis: auto;
        min-height: 340px;
        transform: none;
    }

    .pc-acronym {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 0.8rem;
    }

    .pc-expanded {
        padding: 20px 18px 18px;
        gap: 10px;
    }

    .project-card[active] .project-card__title {
        font-size: 0.9rem;
    }

    .project-card[active] .project-card__desc {
        font-size: 11.5px;
    }

    .controls {
        width: 100%;
        justify-content: flex-end;
    }

    .nav-btn {
        width: 1.8rem;
        height: 1.8rem;
        font-size: 1.1rem;
    }

    .dots {
        display: none;
    }
}