:root {
    --card-height: 180px;
}

.process-carousel {
    display: flex;
    flex-direction: column;
    justify-content: start;
    gap: 2rem;
    width: 100%;
    padding: 2rem 0;
    position: relative;
    z-index: 1;
    max-width: 100%;
    overflow: hidden;
    min-height: 500px;
}

.process-carousel-title {
    text-align: start;
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    gap: 1rem;
    position: relative;
    width: 90%;
    max-width: 100%;
    flex: 1;
    min-height: 100px;
}

.carousel-container {
    flex: 1;
    overflow: visible;
    position: relative;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: max-content;
    /* min-height: calc(var(--card-height) * 1.25); */
    overflow: visible;
    max-width: calc(100% - 120px);
    margin: 0 auto;
}

.carousel-track {
    display: flex;
    align-items: center;
    gap: 2rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: fit-content;
    height: 100%;
    transform: translateX(calc(50% - 190px - (var(--current-index) * 412px)));
}

.carousel-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    /* translucent white */
    border: 1px solid rgba(229, 231, 235, 0.3);
    /* lighter transparent border */
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 380px;
    height: var(--card-height);
    opacity: 0.5;
    transform: scale(0.8);
    pointer-events: none;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.carousel-item.active {
    opacity: 1;
    transform: scale(1.05);
    border-color: rgba(151, 151, 151, 0.6);
    box-shadow: 0 8px 24px rgba(255, 208, 208, 0.2);
    z-index: 10;
    position: relative;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.5);
    width: 380px;
    height: var(--card-height);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.carousel-item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-item.active .carousel-item-image {
    width: 70px;
    height: 70px;
}

.carousel-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.carousel-item.active .carousel-item-image img {
    transform: scale(1.05);
}

.carousel-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
    min-width: 0;
    justify-content: center;
}

.carousel-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(214, 214, 214);
    line-height: 1.4;
    margin: 0;
    transition: all 0.3s ease;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    hyphens: auto;
}

.carousel-item.active .carousel-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.carousel-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
}

.carousel-item.active .carousel-arrow {
    width: 45px;
    height: 45px;
}

.arrow-icon {
    font-size: 1.5rem;
    color: #6B7280;
    font-weight: bold;
    animation: pulse 2s infinite;
    transition: all 0.3s ease;
}

.carousel-item.active .arrow-icon {
    font-size: 1.6rem;
    color: #000000;
    animation: pulseActive 1.5s infinite;
}

/* Navigation buttons */
.carousel-nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    flex-shrink: 0;
    align-self: center;
}

.carousel-nav-button:hover {
    border-color: #871519;
    background: #ffeeee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.carousel-nav-button:active {
    transform: scale(0.95);
}

.nav-arrow {
    font-size: 1.5rem;
    color: #4A0508;
    font-weight: bold;
}

/* Pagination dots */
.carousel-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-shrink: 0;
}

.pagination-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: #D1D5DB;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-dot:hover {
    background: #9CA3AF;
    transform: scale(1.2);
}

.pagination-dot.active {
    background: white;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes pulseActive {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

/* Responsive Design */
@media (max-width: 1280px) {
    .process-carousel {
        min-height: 280px;
    }

    .carousel-container {
        height: 230px;
        max-width: calc(100% - 100px);
    }

    .carousel-item,
    .carousel-item.active {
        width: 350px;
        height: 150px;
    }

    .carousel-track {
        transform: translateX(calc(50% - 175px - (var(--current-index) * 382px)));
    }
}

@media (max-width: 1024px) {
    .process-carousel {
        min-height: 260px;
    }

    .process-carousel-title {
        font-size: 2rem;
    }

    .carousel-container {
        height: 210px;
        max-width: calc(100% - 90px);
    }

    .carousel-item,
    .carousel-item.active {
        width: 300px;
        height: 140px;
        padding: 1.25rem;
    }

    .carousel-item.active {
        transform: scale(1.03);
    }

    .carousel-track {
        gap: 1.5rem;
        transform: translateX(calc(50% - 150px - (var(--current-index) * 324px)));
    }

    .carousel-nav-button {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 768px) {
    .process-carousel {
        min-height: 320px;
    }

    .process-carousel-title {
        font-size: 1.75rem;
        text-align: start;
    }

    .carousel-wrapper {
        position: relative;
        gap: 0;
        min-height: 220px;
    }

    .carousel-container {
        width: 100%;
        height: max-content;
        max-width: calc(100% - 70px);
        margin: 0 auto;
    }

    .carousel-nav-button {
        position: absolute;
        top: 50%;
        transform: translateY(5%);
        width: 35px;
        height: 35px;
        z-index: 30;
    }

    .carousel-nav-left {
        left: 0;
    }

    .carousel-nav-right {
        right: 0;
    }

    .carousel-item,
    .carousel-item.active {
        width: 250px;
        height: 180px;
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .carousel-item.active {
        transform: scale(1.02);
    }

    .carousel-track {
        gap: 1rem;
        transform: translateX(calc(50% - 125px - (var(--current-index) * 266px)));
    }

    .carousel-item-image {
        width: 40px;
        height: 40px;
    }

    .carousel-item.active .carousel-item-image {
        width: 50px;
        height: 50px;
    }

    .carousel-item-title {
        font-size: 0.85rem;
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    .carousel-item.active .carousel-item-title {
        font-size: 0.95rem;
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    .carousel-arrow {
        display: none;
    }
}

@media (max-width: 480px) {
    .process-carousel {
        min-height: 280px;
    }

    .process-carousel-title {
        font-size: 1.5rem;
        padding: 0;
    }

    .carousel-container {
        max-width: calc(100% - 60px);
        height: max-content;
    }

    .carousel-wrapper {
        min-height: 200px;
    }

    .carousel-item,
    .carousel-item.active {
        width: 200px;
        height: 160px;
        padding: 0.75rem;
    }

    .carousel-item.active {
        transform: scale(1.01);
    }

    .carousel-track {
        gap: 0.75rem;
        transform: translateX(calc(50% - 100px - (var(--current-index) * 212px)));
    }

    .carousel-nav-button {
        width: 30px;
        height: 30px;
    }

    .nav-arrow {
        font-size: 1.1rem;
    }

    .carousel-item-title {
        font-size: 0.8rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .carousel-item.active .carousel-item-title {
        font-size: 0.9rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .carousel-item-image {
        width: 35px;
        height: 35px;
    }

    .carousel-item.active .carousel-item-image {
        width: 40px;
        height: 40px;
    }
}

/* Ensure container constraints are respected */
.process-carousel {
    contain: layout size;
}

.carousel-wrapper {
    contain: layout;
}

/* Additional overflow prevention */
* {
    box-sizing: border-box;
}

.carousel-item * {
    max-width: 100%;
}