.wp-block-card-slider-main {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.card-slider {
    max-width: 1400px;
    margin: 0 auto;
}

.mobile-view {
    display: none;
    opacity: 0; /* Start hidden, will be set to 1 when Swiper initializes */
    transition: opacity 0.3s ease;
}

.desktop-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

.card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16/10;
    height: 360px;
    background-color: #f5f5f5;
    transition: transform 0.3s ease;
    display: block;
    text-decoration: none;
    width: 100%;
}

.card:hover {
    transform: translateY(-5px);
}

.card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card__content {
    position: absolute;
    bottom: 0px;
    left: 0;
    right: 0;
    padding: 25px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.card__title {
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 10px;
    color: white;
    text-transform: uppercase;
}

.card__text {
    font-size: 16px;
    margin: 0 0 45px;
    opacity: 0.9;
    line-height: 1.4;
}

.card__arrow {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.card:hover .card__arrow {
    transform: scale(1.1);
}

.card__arrow svg {
    width: 24px;
    height: 24px;
    stroke: #000;
    stroke-width: 2;
    fill: none;
}

@media (max-width: 1024px) {
    .card {
        height: 340px;
    }
    
    .card__title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .desktop-view {
        display: none;
    }

    .mobile-view {
        display: block;
    }

    .swiper {
        width: 100%;
        padding: 0;
        height: 55vh;
        max-height: 450px;
    }

    .swiper-slide {
        height: 100%;
        width: 100%;
    }

    .card {
        height: 100%;
        margin: 0;
        border-radius: 15px;
    }

    .swiper-pagination {
        bottom: 20px !important;
    }

    .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
        background: white;
        opacity: 0.5;
    }

    .swiper-pagination-bullet-active {
        opacity: 1;
    }
    
    /* Fix for Swiper slides not appearing during loading */
    .swiper-wrapper {
        height: 100%;
    }
}

@media (max-width: 480px) {
    .wp-block-card-slider-main {
        padding: 10px;
    }
    
    .card__title {
        font-size: 22px;
    }

    .card__text {
        font-size: 14px;
        margin: 0 0 35px;
    }

    .card__arrow {
        width: 40px;
        height: 40px;
    }

    .card__arrow svg {
        width: 20px;
        height: 20px;
    }
}

/* Fix for slider visibility after swipe */
.swiper-backface-hidden .swiper-slide {
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}