/* Tổng layout 2 cột */
.t888-switcher-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    align-items: stretch;
}

/* ============================================
   SCROLL ANIMATION - FADE IN UP
   ============================================ */

@keyframes fadeInUpBox {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Initial state - ẩn cả 2 box (KHÔNG áp dụng trong Elementor editor) */
body:not(.elementor-editor-active) .t888-switcher-left-wrap,
body:not(.elementor-editor-active) .t888-switcher-grid {
    opacity: 0;
    transform: translateY(40px);
}

/* Hiển thị bình thường trong Elementor editor */
body.elementor-editor-active .t888-switcher-left-wrap,
body.elementor-editor-active .t888-switcher-grid {
    opacity: 1;
    transform: translateY(0);
}

/* Animate khi scroll đến (trigger by class) - KHÔNG trong editor */
body:not(.elementor-editor-active) .t888-switcher-section.animate-visible .t888-switcher-left-wrap {
    animation: fadeInUpBox 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.2s;
}

body:not(.elementor-editor-active) .t888-switcher-section.animate-visible .t888-switcher-grid {
    animation: fadeInUpBox 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.5s; /* Hiện sau left 300ms */
}

/* LEFT background #F5F5F5 như Figma */
.t888-switcher-left-wrap {
    background: #F5F5F5;
    padding: 34px 39px 34px 39px;
}

.t888-switcher-left-card {
    background: #fff;
    border-radius: 20px;
    padding: 50px 50px 10px 38px;
    height: 100%;
}

/* Left content show 1 item with smooth fade */
.t888-switcher-content-item {
    display: none;
    opacity: 0;
}

.t888-switcher-content-item.active {
    display: block;
    opacity: 1;
}

/* Fade out animation */
.t888-switcher-content-item.fade-out {
    animation: fadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Fade in animation */
.t888-switcher-content-item.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.t888-switcher-left-icon {
    width: 140px;
    /* height: 64px; */
    object-fit: contain;
    /* margin-bottom: 14px; */
}

.t888-switcher-left-title {
    margin-top: 30px;
    color: #00377B;
    font-weight: 700;
    font-size: 28px;
    line-height: 38px;

}

.t888-switcher-left-desc {
    color: #757575;
    font-size: 18px;
    line-height: 25px;
    /* max-width: 520px; */
    margin-top: 20px;
}

/* RIGHT grid mosaic */
/* RIGHT grid mosaic (đúng pixel Figma) */
.t888-switcher-grid {
    display: grid;
    grid-template-columns: 233px 232px 230px;
    grid-template-rows: 230px 230px 230px;

    gap: 5px;
    background: #fff;

    padding: 2px;
    /* tạo khung divider bên ngoài */
    box-sizing: border-box;
}

/* Card base giữ nguyên của anh, chỉ thêm box-sizing */
.t888-switcher-card {
    position: relative;
    padding: 18px;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
}

.t888-switcher-card-title {
    font-weight: 700;
    font-size: 20px;
    line-height: 27px;
    text-transform: capitalize;

}

/* icon bottom-left (nền trắng) */
.t888-switcher-card-icon {
    position: absolute;
    left: 18px;
    bottom: 18px;
    max-width: 80px;
    max-height: 80px;

    border-radius: 4px;
    display: grid;
    place-items: center;
}

.t888-switcher-card-icon img {
    /* width: 26px;
  height: 26px; */
    object-fit: contain;
}

/* Active state (nhẹ thôi) */
/* .t888-switcher-card.active {
    outline: 2px solid rgba(255, 255, 255, .8);
    outline-offset: -2px;
} */

/* Light card (ô trắng bên phải dưới) */
.t888-switcher-card.active {
    background: #fff !important;
    color: #5D4299;
    border: 1px solid #5D4299;
    transition: all 0.3s ease;
}
.t888-switcher-card.active .t888-switcher-card-title{
    color: #5D4299;
    transition: all 0.3s ease;
}
.t888-switcher-card.active 
.t888-switcher-card.is-light .t888-switcher-card-icon {
    background: transparent;
    border-radius: 8px;
}

.t888-switcher-card.is-light .t888-switcher-card-icon img {
    /* filter: none; */
}

/* Mapping theo thứ tự item => ra đúng Figma (cần 6 items) */
.t888-switcher-card:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1;
}

/* hồng 465x230 */
.t888-switcher-card:nth-child(2) {
    grid-column: 3 / 4;
    grid-row: 1;
}

/* xanh 230x230 */
.t888-switcher-card:nth-child(3) {
    grid-column: 1 / 2;
    grid-row: 2;
}

/* xanh dương 230x230 */
.t888-switcher-card:nth-child(4) {
    grid-column: 2 / 4;
    grid-row: 2;
}

/* cam 465x230 */
.t888-switcher-card:nth-child(5) {
    grid-column: 1 / 3;
    grid-row: 3;
}

/* xanh ngọc 465x230 */
.t888-switcher-card:nth-child(6) {
    grid-column: 3 / 4;
    grid-row: 3;
}


/* Đổi màu trắng */
.t888-switcher-card:not(.active) .t888-switcher-card-icon img {
    filter: brightness(0) invert(1);
}

.t888-switcher-card:not(.active) .t888-switcher-card-title {
    color: #fff;
}

/* ========== RESPONSIVE: MOBILE SLIDE ========== */
@media (max-width: 1024px) {
    .t888-switcher-section {
        display: block;
        padding: 0;
    }
    .t888-switcher-left-wrap {
        padding: 0;
    }
    .t888-switcher-left-card {
        padding: 40px;
        border-radius: 0;
        background: #F5F5F5;
    }
    .t888-switcher-content-item {
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }
    .t888-switcher-content-item.active {
        display: block;
        opacity: 1;
    }
    .t888-switcher-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0;
        padding: 0 0 8px 0;
        background: none;
        box-shadow: none;
        border-radius: 0;
    }
    .t888-switcher-card {
        min-width: 48vw;
        max-width: 60vw;
        height: 150px;
        margin-right: 2px;
        padding: 13px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: space-between;
        position: relative;
        box-sizing: border-box;
        transition: background 0.2s, color 0.2s;
    }
    .t888-switcher-card:last-child {
        margin-right: 0;
    }
    .t888-switcher-card-title {
        font-size: 16px;
        line-height: 22px;
        color: #fff;
        text-align: left;
        white-space: normal;
    }
    .t888-switcher-card-icon {
        position: static;
        max-width: 50px;
        max-height: 50px;
        margin-top: 2px;
        margin-bottom: 0;
        border-radius: 4px;
        background: transparent;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .t888-switcher-card.active {
        background: #fff !important;
        color: #5D4299;
        border: 2px solid #5D4299;
    }
    .t888-switcher-card.active .t888-switcher-card-title {
        color: #5D4299;
    }
    .t888-switcher-card.active .t888-switcher-card-icon img {
        filter: none;
    }
    /* Hide scroll bar for grid */
    .t888-switcher-grid::-webkit-scrollbar {
        display: none;
    }
    .t888-switcher-left-title{
        font-size: 20px;
        line-height: 27px;
    }
    .t888-switcher-left-desc{
        font-size: 16px;
        line-height: 22px;
    }
}

