/* --- Vars & layout --- */
.why-us-carousel {
    position: relative;
    --cols: 4;
    /* desktop: show 4 fully */
    --gap: 20px;
    /* spacing between cards */
}

.carousel-arrow.prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.carousel-arrow.next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Header (unchanged) */
.why-us-carousel .carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

/* Track: single source of truth */
.carousel-track {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-inline: var(--pad);
    padding: 0 0 24px 0;
    box-sizing: border-box;
}

/* Hide scrollbar (optional) */
.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Cards: computed width from columns & gap. No fixed px width/height. */
.carousel-card {
    flex: 0 0 calc((100% - (var(--gap) * (var(--cols) - 1))) / var(--cols));
    scroll-snap-align: start;
    border-radius: 16px;
    color: white;
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Keep a nice shape without forcing fixed height */
    aspect-ratio: 29 / 42;
    /* ~0.69 similar to your 290x420 */
    min-height: 320px;
    /* safety so very wide screens don't crush the card */
}

/* Remove first/last extra margins – track padding handles the insets */
.carousel-track .carousel-card:first-child {
    margin-left: 0;
}

.carousel-track .carousel-card:last-child {
    margin-right: 0;
}

/* Image as background */
.carousel-card picture {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    z-index: -2;
}

.carousel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    border-radius: 16px;
}

/* Video wrapper keeps full area */
.carousel-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-video-wrapper video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Play/Pause buttons (unchanged visuals) */
.carousel-video-play-btn,
.carousel-video-pause-btn {
    position: absolute;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 3;
}

.carousel-video-play-btn {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
}

.carousel-video-play-btn svg {
    width: 60px;
    height: 60px;
    transition: transform 0.2s ease;
}

.carousel-video-play-btn:hover svg {
    transform: scale(1.1);
}

.carousel-video-pause-btn {
    top: 10px;
    right: 10px;
}

.carousel-video-pause-btn svg {
    width: 40px;
    height: 40px;
    transition: transform 0.2s ease;
}

.carousel-video-pause-btn:hover svg {
    transform: scale(1.1);
}

/* Hide anchors that only hold video URLs */
.carousel-card a[href$=".mp4"],
.carousel-card a[href*="youtube"],
.carousel-card a[href*="vimeo"] {
    display: none !important;
}

/* Footer & dots */
.carousel-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 20px;
    flex-direction: row-reverse;
    padding: 0 24px;
}

.carousel-pagination {
    display: flex;
    gap: 25px;
    justify-content: center;
    margin: 0 auto;
}

.why-us-carousel .carousel-dot {
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
    padding: 9px;
    background: rgba(17, 17, 17, 0.2);
}

.why-us-carousel-container .default-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* .why-us-carousel-container .default-content-wrapper h1 {
    font-size: 32px;
} */

.why-us-carousel .carousel-dot.active {
    background: linear-gradient(to bottom right, #8e0006, #4e0003);
    width: 74px;
    border-radius: 10px;
    height: 18px;
    transform: unset;
}

/* .why-us-carousel-container .default-content-wrapper p{width: 24%;} */
/* Arrows */
.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-arrow.next {
    right: -26px;
    position: absolute;
}

.carousel-arrow.prev {
    left: -25px;
    position: absolute;
}

.carousel-arrow {
    background: #fff;
    height: 52px;
    width: 52px;
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 32px;
    cursor: pointer;
}

.carousel-arrow.prev::before {
    content: "\2039";
    font-size: 34px;
    font-weight: 100;
    color: #333;
    position: relative;
    line-height: 22px;
}

.carousel-arrow.next::before {
    content: "\203A";
    font-size: 34px;
    font-weight: 100;
    color: #333;
    position: relative;
    line-height: 22px;
}

/* Home finance overrides */
.home-finance .carousel-card {
    text-align: left;
    background: linear-gradient(180deg,
            #111111 -33.03%,
            rgba(17, 17, 17, 0.4) 40.16%,
            rgba(17, 17, 17, 0) 86.36%);
    padding: 0;
}

.home-finance .carousel-card-title p,
.home-finance .carousel-card-description p {
    font-size: 20px;
    margin: 0;
    line-height: 120%;
    width: 85%;
}

.home-finance .carousel-card-description p {
    font-size: 16px;
    font-weight: 300;
    margin-top: 16px;
}

.home-finance .carousel-card-text {
    background: rgba(17, 17, 17, 0.4);
    /* transparent dark overlay */
    backdrop-filter: blur(8px);
    /* blur effect */
    -webkit-backdrop-filter: blur(8px);
    /* Safari support */
    color: #fff;
    padding: 16px;
    font-size: 14px;
    line-height: 1.5;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    border-radius: 0 0 16px 16px;
    text-align: left;
}

.carousel-footer .carousel-controls {
    display: flex;
    position: absolute;
    top: 39%;
    left: 0;
    /* gap: 69rem; */
    width: 100%;
    justify-content: space-between;
}

.home-finance .carousel-card-title,
.home-finance .carousel-card-description,
.home-finance .carousel-card-text {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.home-finance .carousel-card-title.hide-desc,
.home-finance .carousel-card-description.hide-desc,
.home-finance .carousel-card-text.hide-desc {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.home-finance .carousel-card-title,
.home-finance .carousel-card-description {
    position: absolute;
    top: 22px;
    left: 22px;
    width: 100%;
}

.home-finance .carousel-card-description {
    top: 33px;
}

.carousel-track.home-lone-card {
    gap: 40px;
    padding: 0;
}

.carousel-track.home-lone-card .carousel-card {
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0;
    text-align: left;
    min-height: 362px;
    aspect-ratio: unset;
    flex: 0 0 calc((100% - (40px * (var(--cols) - 1))) / var(--cols));
}

/* Image section */
.home-lone-card .carousel-card picture {
    position: relative;
     z-index: 1;
}

.home-lone-card .carousel-card picture img {
    border-radius: 0;
}

/* Title */
.home-lone-card .carousel-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #111111;
    /* width: 80%; */
    font-family: var(--body-font-family-semibold);
    line-height: 120%;
}

/* Description */
.home-lone-card .carousel-card-description p {
    font-size: 16px;
    color: #555;
    line-height: 150%;
    font-weight: 400;
    margin-top: 0;
}

/* Button */
.home-lone-card p {
    margin: 15px 20px 10px 30px;
    font-family: var(--body-font-family-semibold);
    line-height: 120%;
}

.home-lone-card .carousel-card-text .button {
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    color: #ee6f32;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.home-lone-card .carousel-card-text .button::after {
    font-size: 31px;
    line-height: 20px;
    font-weight: 100;
    color: #ee6f32;
    content: "\203A";
    position: absolute;
    right: -19px;
    top: -2px;
}

.carousel-new-cards .carousel-card {
    background: none;
}

.carousel-new-cards .carousel-card-title {
    top: 63px;
    font-weight: 600;
}

.carousel-new-cards .carousel-card-description {
    top: 75px;
}

.carousel-new-cards .carousel-card-title,
.carousel-new-cards .carousel-card-description {
    left: 30px;
}

.carousel-new-cards .carousel-card-text {
    top: 72%;
    left: 2px;
    background: none;
    backdrop-filter: none;
}

@media (max-width: 1024px) {
    .carousel-track.home-lone-card .carousel-card-image {
        width: 100%;
    }
}

/* --- Responsive columns (use px only for padding; widths are % based) --- */
@media (max-width: 1200px) {
    .why-us-carousel {
        --cols: 3;
    }
}

@media (max-width: 992px) {
    .why-us-carousel {
        --cols: 2;
    }


}

@media (max-width: 767px) {
    .why-us-carousel {
        --cols: 1;
    }


    .why-us-carousel-wrapper {
        /* padding: 0 0 0 24px !important; */
    }

    .carousel-card {
        min-height: 280px;
        flex: 0 0 calc((80% - (var(--gap) * (var(--cols) - 1))) / var(--cols));
    }

    .home-finance .carousel-card-title p {
        font-size: 16px;
        top: 10px;
        left: 14px;
    }

    .home-finance .carousel-card-title {
        top: 10px;
        left: 14px;
    }

    .home-finance .carousel-card-description {
        top: 20px;
        left: 14px;
    }

    .home-finance .carousel-card-description p {
        font-size: 14px;
    }

    .why-us-carousel-container .default-content-wrapper {
        flex-direction: column;
    }

    /* .why-us-carousel-container .default-content-wrapper h1 {
        font-size: 24px;
        margin-top: 10px;
    } */

    .why-us-carousel-container .default-content-wrapper p {
        font-size: 14px;
        line-height: 150%;
        width: 100%;
    }

    .why-us-carousel .carousel-dot {
        padding: 3px;
        height: 6px;
        width: 6px;
    }

    .why-us-carousel .carousel-dot.active {
        width: 24px;
        height: 6px;
    }

    .carousel-footer {
        margin-top: 0;
        padding-right: 0;
    }

    .why-us-carousel .carousel-pagination {
        justify-content: flex-end;
        gap: 7px;
        margin-top: 0;
        margin-right: unset;
    }

    .why-us-carousel .carousel-header {
        margin: 0;
    }

    .home-lone-card p {
        margin: 8px 16px;
    }

    .home-lone-card .carousel-card-title {
        font-weight: 600;
        font-size: 20px;
        color: #111111;
        width: 100%;
    }

    .home-lone-card .carousel-card-description p {
        font-size: 16px;
    }

    .carousel-track.home-lone-card {
        padding: 0;
        margin-bottom: 20px;
        /* display: flex;
        flex-direction: column; */
    }

    .carousel-track.home-lone-card .carousel-card-image {
        width: 100%;
    }

    .carousel-track.home-lone-card .carousel-card-image picture {
        z-index: 1;
    }
}

/* Desktop: no thumb/drag scroll, no snap */
@media (min-width: 769px) {
    .carousel-track {
        overflow-x: hidden;
        scroll-snap-type: none;
    }

    .carousel-footer .carousel-controls {
        display: flex;
        /* show arrows on desktop */
    }
}

/* Mobile: thumb scroll + snap; hide arrows */
@media (max-width: 767px) {
    .carousel-track {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .carousel-footer .carousel-controls {
        display: none;
        /* hide arrows on mobile */
    }

    .carousel-track.home-lone-card .carousel-card {
        min-height: 315px;
        /* background-color: #FEF2ED;
          padding-bottom: 20px; */
        background: #fef2ed;
        border-radius: 16px;
    }

    .carousel-new-cards .carousel-card-description {
        top: 75px;
    }

    .carousel-new-cards .carousel-card-title {
        top: 63px;
        font-weight: 600;
    }
}

@media (max-width: 380px) {
    .mobile-nav-right{
        padding: 5px !important;
    }

    .mobile-banner{
        margin-top: 10px !important;
    }

    .mobile-tiles {
        gap: 8px !important;
    }

    .mobile-nav-right .mobile-nav-content{
        padding: 8px !important;
    }
}