.afce-services-carousel,
.afce-services-carousel * {
    box-sizing: border-box;
}

.afce-services-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    --afce-row-height: clamp(300px, 38vw, 420px);
    --afce-navy: #102544;
}

.afce-services-carousel__stage {
    position: relative;
    width: 100%;
}

.afce-services-carousel__stage--mobile {
    display: none;
}

.afce-services-carousel__viewport {
    width: 100%;
    overflow: hidden;
}

.afce-services-carousel__track {
    display: flex;
    width: 100%;
    will-change: transform;
    transition: transform 520ms ease;
}

.afce-services-carousel.is-dragging .afce-services-carousel__track {
    transition: none;
}

.afce-services-slide,
.afce-services-mobile-slide {
    flex: 0 0 100%;
    width: 100%;
}

.afce-services-slide {
    display: grid;
    grid-template-rows: repeat(2, minmax(var(--afce-row-height), auto));
}

.afce-services-mobile-slide {
    display: block;
}

.afce-services-slide[aria-hidden="true"],
.afce-services-mobile-slide[aria-hidden="true"] {
    pointer-events: none;
}

.afce-services-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: var(--afce-row-height);
    width: 100%;
    color: inherit;
    text-decoration: none !important;
    overflow: hidden;
}

.afce-services-card:hover,
.afce-services-card:focus {
    color: inherit;
    text-decoration: none !important;
}

.afce-services-card:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: -8px;
}

.afce-services-card--reverse .afce-services-card__media {
    order: 2;
}

.afce-services-card--reverse .afce-services-card__panel {
    order: 1;
}

.afce-services-card__media,
.afce-services-card__panel {
    min-width: 0;
    min-height: var(--afce-row-height);
}

.afce-services-card__media {
    position: relative;
    overflow: hidden;
    line-height: 0;
    background: #f1f3f5;
}

.afce-services-card__image,
.afce-services-card__media img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.012);
}

.afce-services-card__placeholder {
    width: 100%;
    height: 100%;
    min-height: var(--afce-row-height);
    background: linear-gradient(135deg, #f2f2f2 0%, #d9d9d9 100%);
}

.afce-services-card__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vw, 70px);
    background: var(--afce-service-bg, #00a99d);
}

.afce-services-card__box {
    width: min(100%, 380px);
    min-height: clamp(230px, 25vw, 310px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 4vw, 54px) clamp(22px, 4vw, 46px);
    background: #ffffff;
    text-align: center;
    color: var(--afce-service-text, #111111);
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.afce-services-card:hover .afce-services-card__box,
.afce-services-card:focus-visible .afce-services-card__box {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

.afce-services-card__title {
    margin: 0 0 18px;
    font-size: clamp(24px, 2.6vw, 34px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--afce-service-text, #111111);
}

.afce-services-card__description {
    margin: 0;
    max-width: 295px;
    font-size: clamp(16px, 1.4vw, 20px);
    line-height: 1.25;
    font-weight: 400;
    color: var(--afce-service-text, #111111);
    opacity: 0.55;
}

.afce-services-carousel__nav {
    position: absolute;
    right: clamp(24px, 5vw, 56px);
    bottom: clamp(22px, 4vw, 42px);
    z-index: 4;
    display: flex;
    gap: 12px;
    align-items: center;
}

.afce-services-carousel__button {
    width: clamp(58px, 7vw, 76px);
    height: clamp(58px, 7vw, 76px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: var(--afce-navy);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1;
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.afce-services-carousel__button:hover,
.afce-services-carousel__button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.afce-services-carousel__button:focus-visible {
    outline: 3px solid var(--afce-navy);
    outline-offset: 3px;
}

.afce-services-carousel__button[hidden] {
    display: none;
}

.afce-services-empty {
    padding: 16px;
    border-left: 4px solid #d63638;
    background: #fff8f8;
}

@media (prefers-reduced-motion: reduce) {
    .afce-services-carousel__track,
    .afce-services-card__box,
    .afce-services-carousel__button {
        transition: none;
    }
}

@media (max-width: 767px) {
    .afce-services-carousel {
        --afce-row-height: 280px;
    }

    .afce-services-carousel__stage--desktop {
        display: none;
    }

    .afce-services-carousel__stage--mobile {
        display: block;
    }

    .afce-services-slide {
        grid-template-rows: none;
    }

    .afce-services-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .afce-services-card--reverse .afce-services-card__media,
    .afce-services-card__media {
        order: 1;
    }

    .afce-services-card--reverse .afce-services-card__panel,
    .afce-services-card__panel {
        order: 2;
    }

    .afce-services-card__media {
        min-height: var(--afce-row-height);
    }

    .afce-services-card__panel {
        padding: 28px 20px;
        min-height: auto;
    }

    .afce-services-card__box {
        min-height: 210px;
        width: min(100%, 340px);
    }

    .afce-services-carousel__nav--desktop {
        display: none !important;
    }

    .afce-services-carousel__mobile-nav {
        position: static;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 18px;
        width: 100%;
        padding: 16px 0 4px;
        background: transparent;
    }

    .afce-services-carousel__mobile-button {
        width: auto;
        height: auto;
        min-width: 32px;
        padding: 0 4px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--afce-navy);
        box-shadow: none;
        font-size: 30px;
        font-weight: 500;
        line-height: 1;
        cursor: pointer;
    }

    .afce-services-carousel__mobile-button:hover,
    .afce-services-carousel__mobile-button:focus-visible {
        transform: none;
        box-shadow: none;
    }

    .afce-services-carousel__mobile-button:focus-visible {
        outline: 2px solid var(--afce-navy);
        outline-offset: 4px;
    }

    .afce-services-carousel__mobile-button:disabled {
        opacity: 0.28;
        cursor: not-allowed;
    }

    .afce-services-carousel__counter {
        min-width: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--afce-navy);
        font-size: 18px;
        font-weight: 700;
        line-height: 1;
    }
}
