/* ==========================================================================
   Services Swiper
   ========================================================================== */

/* ---- Carousel wrapper ---- */
.sc-carousel {
    position: relative;
    overflow: visible;
    width: 100%;
    /* Ensure nav divs are clickable above the track */
    isolation: isolate;
}

/* ---- Track ---- */
.sc-carousel__track {
    display: flex;
    gap: 20px;
    transform: translateX(0);
    transition: transform 0.2s ease-in-out;
    will-change: transform;
    /* Allow nav siblings to sit above */
    position: relative;
    z-index: 0;
}

/* ---- Track spacer — breathing room after last slide ---- */
.sc-carousel__track::after {
    content: "";
    flex-shrink: 0;
    width: calc(50vw - 620px - 20px);
    min-width: 40px;
}

/* ---- Desktop: page wrappers are invisible — slides sit in the flex row ---- */
.sc-carousel__page {
    display: contents;
}

/* ---- Slide ---- */
.sc-carousel__slide {
    flex: 0 0 290px;
    width: 290px;
    min-height: 385px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
}

/* ---- Image wrap ---- */
.sc-carousel__image-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    flex: 1;
}

.sc-carousel__image-wrap img {
    width: 290px;
    height: 350px;
    object-fit: cover;
    object-position: center;
    border-radius: 5px;
    transition: transform 0.5s ease;
    display: block;
}

.sc-carousel__slide:hover .sc-carousel__image-wrap img {
    transform: scale(1.02);
}

/* ---- Hover arrow (centered over image) ---- */
.sc-carousel__arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 55px;
    height: 55px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition-duration: 200ms;
    transition-property: background-color, opacity, transform;
}

.sc-carousel__arrow svg {
    display: block;
    width: 25px;
    height: 25px;
    fill: #ffffff;
}

.sc-carousel__slide:hover .sc-carousel__arrow {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ---- Title ---- */
.sc-carousel__title {
    font-family: "Lota Grotesque", serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.3334em;
    letter-spacing: 0.1em;
    margin: 10px 0 0;
    transition: color 0.2s ease-in-out;
}

.sc-carousel__slide:hover .sc-carousel__title {
    color: #2074A4;
}

/* ---- Nav divs (not <button>) ---- */
.sc-carousel__nav {
    position: absolute;
    z-index: 20;
    top: 45%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 0;
    box-sizing: border-box;
    pointer-events: auto;
    user-select: none;
    transition-duration: 200ms;
    transition-property: background-color, opacity;
}

.sc-carousel__nav svg {
    display: block;
    width: 14px;
    height: 14px;
    fill: #ffffff;
    flex-shrink: 0;
    pointer-events: none;
}

/* Prev: hidden until user scrolls right */
.sc-carousel__nav--prev {
    left: 10px;
    opacity: 0;
    pointer-events: none;
    transition-property: background-color, opacity;
}

.sc-carousel__nav--prev.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Next: always visible initially */
.sc-carousel__nav--next {
    right: 30px;
}

/* Disabled state */
.sc-carousel__nav.is-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.sc-carousel__nav:hover:not(.is-disabled) {
    background-color: rgba(0, 0, 0, 1);
}

/* ---- Tablet ---- */
@media (max-width: 1024px) {
    .sc-carousel__image-wrap img {
        width: 100%;
        height: 200px;
    }
}

/* ---- Mobile — 2×2 paged grid, swipe between pages ---- */
@media (max-width: 767px) {

    /* Wrapper: clip to viewport, enable horizontal scroll snap */
    .sc-carousel {
        overflow: hidden;
    }

    /* Track: flat flex row of pages, no JS transform */
    .sc-carousel__track {
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        transform: none !important;
        transition: none;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }

    .sc-carousel__track::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    /* Hide the ::after spacer */
    .sc-carousel__track::after {
        display: none;
    }

    /* Each page: full viewport width, 2×2 grid, snap point */
    .sc-carousel__page {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        flex: 0 0 100%;
        width: 100%;
        padding: 0 4px;
        box-sizing: border-box;
        scroll-snap-align: start;
    }

    .sc-carousel__slide {
        width: 100%;
        flex: unset;
        min-height: auto;
    }

    .sc-carousel__image-wrap img {
        width: 100%;
        height: 140px;
    }

    /* No hover arrows on touch */
    .sc-carousel__arrow {
        display: none;
    }

    /* Hide desktop nav */
    .sc-carousel__nav {
        display: none !important;
    }

    .sc-carousel__title {
        font-size: 11px;
        letter-spacing: 0.08em;
    }
}