
.acf-cards-wrapper {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ==========================================
   1. CHẾ ĐỘ AUTO SCROLL (ENABLE_SLIDER = TRUE)
   ========================================== */

.slider-scroll {
    overflow: hidden;
    position: relative;
    width: 100%;
    cursor: grab;
    user-select: none;
    padding: 8px 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
}

.slider-scroll:active {
    cursor: grabbing;
}

.track-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 16px;
    padding-right: 16px;
    width: max-content !important;
    will-change: transform;
}

/* Kích thước Card trong Slider */
.acf-cards-wrapper.is-slider .card-item {
    flex-shrink: 0 !important;
    width: max-content;
    min-width: 200px;  
    max-width: 500px; 
}


/* ==========================================
   2. CHẾ ĐỘ CHIA CỘT GRID (ENABLE_SLIDER = FALSE)
   ========================================== */

.acf-cards-wrapper.is-grid .cards-list-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(var(--cols-desktop, 3), 1fr);
    align-items: stretch;
}

.acf-cards-wrapper.is-grid .card-item {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 100%;
}

@media (max-width: 1000px) {
    .acf-cards-wrapper.is-grid .cards-list-grid {
        grid-template-columns: repeat(var(--cols-tablet, 2), 1fr);
    }
}

@media (max-width: 500px) {
    .acf-cards-wrapper.is-grid .cards-list-grid {
        grid-template-columns: repeat(var(--cols-mobile, 1), 1fr);
    }
    .acf-cards-wrapper.is-slider .card-item {
       
        max-width: 300px;
    }
    .card-inner{
        flex-direction: column !important;
    }
    .card-image{
        flex: 0 0 1;
    }
}


/* ==========================================
   3. CẤU TRÚC CARD ITEM & 4 LAYOUTS
   ========================================== */

.card-item {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.card-inner {
    display: flex;
    gap: 15px;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* 4 Layouts Tùy Biến */
.card-item.layout-img-left .card-inner   { flex-direction: row; }
.card-item.layout-img-right .card-inner  { flex-direction: row-reverse; }
.card-item.layout-img-top .card-inner    { flex-direction: column; justify-content: flex-start; }
.card-item.layout-img-bottom .card-inner { flex-direction: column-reverse; justify-content: flex-end; }

.card-image {
    flex-shrink: 0;
    flex: 0 0 30%;
}

.card-item.layout-img-top .card-image,
.card-item.layout-img-bottom .card-image {
    max-width: 100%;
    width: 100%;
}

.card-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    pointer-events: none; 
}

.card-content {
    flex-grow: 1;
    white-space: normal;
}