.carousel-and-detail {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 40px;
}

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

.carousel {
    display: flex;
    transition: transform 0.3s ease;
    gap: 0;
    width: 100%;
}

.slide {
    min-width: 100%;
    width: 100%;
    padding: 0;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.slide img {
    object-fit: cover;
    width: 100%;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.slide.current img {
    filter: grayscale(0);
}

.slide .name {
    margin-top: 10px;
    font-weight: bold;
}

@media screen and (min-width: 768px) {
    .slide {
        position: relative;
    }

}

.nav-btn {
    cursor: pointer;
    font-size: 24px;
    display: flex;
    padding: 12px;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    border: 1px solid #003D7C;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 30px;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.detail-panel {
    width: 100%;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.detail-panel>div:first-of-type {
    order: 2;
}

.detail-panel>div:last-child {
    order: 1;
}

.detail-panel * {
    color: #141414;
    font-style: normal;
}

.detail-panel h2 {
    margin: 0;
    color: #00345E;
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    line-height: 25px;
}

.detail-panel h3 {
    color: #00345E;
    font-size: 20px;
    font-style: normal;
    font-weight: 700;
    line-height: 25px;
    margin: 0;
}

.detail-panel .quote {
    color: #00427D;
    font-size: 20.8px;
    font-style: normal;
    font-weight: 700;
    line-height: 29.12px;
    align-self: stretch;
}

.detail-panel .button .up-arrow {
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.detail-panel .button:hover .up-arrow {
    transform: rotate(0deg);
}

.detail-panel .button {
    display: inline-flex;
    padding: 12px;
    align-items: center;
    gap: 8px;
    background: #003D7C;
}

.detail-panel .button span {
    color: #FFF;
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;
}

#detailPanel {
    padding: 0;
}

#detailPanel>div:first-of-type {
    order: 1;
}

#detailPanel>div:last-child {
    order: 2;
}

#detailPanel2 {
    padding: 0;
}

@media screen and (min-width: 1024px) {
    .detail-panel {
        grid-template-columns: 1fr 500px;
        padding: 0;
        gap: 90px;
    }

    #detailPanel {
        grid-template-columns: 1fr 200px;
    }

    .detail-panel>div:first-of-type {
        order: 1;
    }

    .detail-panel>div:last-child {
        order: 2;
        text-align: right;
    }

    .detail-content {
        display: flex;
        flex-direction: column;
        gap: 28px;
    }

    .detail-panel h2 {
        font-size: 31px;
        font-weight: 400;
        line-height: 39px;
    }

    .detail-panel h3 {
        color: #00345E;
        font-size: 39px;
        font-weight: 700;
        line-height: 49px;
    }
}

.slide-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background 0.3s ease;
    border: 1px solid #00345E;
}

.dot.active {
    background: #00345E;
    border: 1px solid transparent;
}

.profile-content {
    display: flex;
    padding: 20px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    align-self: stretch;
    border-radius: 5px;
    background: #FFF;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.10);
}

.profile-content .title {
    color: #00345E;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 25px;
}

.profile-content .name {
    color: #00345E;
    font-size: 25px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    margin: 0;
}

@media screen and (min-width: 1024px) {
    .profile-content {
        position: absolute;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
    }

}

@media (min-width: 768px) {
    .carousel-and-detail {
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    .carousel-wrapper,
    .detail-panel {
        flex: 1;
    }

    .carousel-and-detail {
        gap: 3rem;
    }

    .carousel {
        gap: 50px;
        /* Add gap for desktop */
        padding-right: 50px;
        /* Add padding to prevent last slide cutoff */
    }

    .slide {
        min-width: calc((100% - 150px) / 4);
        /* Adjust width calculation to account for gaps and padding */
    }

    .carousel-wrapper {
        position: relative;
        padding: 0 50px;
        /* Add padding for nav buttons */
        overflow: visible;
        /* Changed from auto to visible */
    }

    .nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

    .nav-buttons {
        position: absolute;
        width: 100%;
        left: 0;
        top: 0;
        bottom: 0;
        pointer-events: none;
        /* Allow clicks to pass through to carousel */
    }

    .nav-buttons .nav-btn {
        pointer-events: all;
        /* Re-enable clicks for buttons */
    }

    .prev {
        left: -50px;
        /* Position outside the carousel */
    }

    .next {
        right: -50px;
        /* Position outside the carousel */
    }

    .nav-buttons {
        display: block;
        margin-top: 0;
    }

    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }

    .slide-dots {
        display: none;
    }

    .carousel-wrapper {
        position: relative;
        width: 100%;
        padding: 0;
        overflow: hidden;
    }

    .carousel {
        width: 100%;
        gap: calc((100% - (4 * 23%)) / 3);
        /* Distribute remaining space evenly between slides */
        padding: 0;
    }

    .slide {
        width: 23%;
        /* Fixed width percentage for each slide */
        min-width: 23%;
    }
}