/* =========================================
   TRANG CHỦ - HERO SECTION (ONE SCREEN FIXED)
   ========================================= */

/* 1. RESET & LAYOUT CHÍNH */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body.home {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* 3. ẨN FOOTER */
body.home .site-footer {
    display: none !important;
}


/* =========================================
   HERO SECTION LAYOUT
   ========================================= */
.home-hero-section {
    background: linear-gradient(110deg, #181d26 0%, #2b3242 50%, #4a5263 100%);
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    padding: 40px 0;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;

    /* --- CHỈNH SỬA 1: Tăng độ rộng container để Slider có chỗ lùi sang phải --- */
    max-width: 1350px;

    margin: 0 auto;
    padding: 0 40px;
    /* Tăng padding 2 bên cho thoáng */
    gap: 20px;
}

/* --- CỘT TRÁI (TEXT) --- */
.hero-text-wrapper {
    flex: 1;
    max-width: 550px;
    z-index: 2;
}

.hero-title {
    font-size: 60px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 50px;
    color: #fff;
}

.hero-highlight {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.highlight-icon {
    width: 48px;
    height: 48px;
    background: #faff00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    flex-shrink: 0;
}

.highlight-icon svg {
    width: 22px;
    height: 22px;
}

.highlight-text {
    font-size: 24px;
    font-weight: 400;
    color: #e5e7eb;
    line-height: 1.3;
    margin: 0;
}

.hero-desc {
    font-size: 15px;
    color: #9ca3af;
    line-height: 1.6;
    max-width: 420px;
    margin: 0;
}


/* --- CỘT PHẢI: SLIDER STRUCTURE (CHỈNH DỊCH PHẢI) --- */
.hero-slider-structure {
    flex: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    max-width: 700px;
    width: 100%;
    margin-left: auto;
    /* Đẩy hết về phía bên phải */
    transform: translateX(30px);
    /* Dịch chuyển cưỡng bức sang phải thêm 30px */
    /* margin-top: 60px; */
    padding: 0 40px;
    box-sizing: border-box;
}

/* NÚT ĐIỀU HƯỚNG */
.hero-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1a1a1a;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 20;
}

.hero-nav-btn:hover {
    background: #faff00;
    transform: translateY(-50%) scale(1.1);
}

.hero-nav-btn svg {
    width: 20px;
    height: 20px;
}

.hero-nav-btn.prev {
    left: -10px;
}

.hero-nav-btn.next {
    right: -10px;
}

/* VIEWPORT */
.hero-viewport {
    width: 100%;
    overflow: hidden;
    border-radius: 30px;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    background: transparent;
}

/* TRACK */
.hero-track {
    display: flex;
    width: 100%;
    gap: 50px;
}

/* HERO CARD */
.hero-card {
    min-width: 100%;
    background: #f1f2f4;
    padding: 20px 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: auto;
}

.card-img {
    height: 230px;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #ddd;
    position: relative;
}

/* Tìm đoạn cũ và thay bằng đoạn này */
.card-img img {
    width: 100% !important;
    height: 100% !important; 
    object-fit: cover;      
    display: block;        
    border-radius: 20px; 
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.card-category {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
}

.card-desc {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
    flex: 1;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-hero-section p {
    margin-block-end: 0 !important; /* Xóa cái 37px đáng ghét kia */
    margin-bottom: 0 !important;    /* Đảm bảo tương thích mọi trình duyệt */
}

/* 2. Khôi phục khoảng cách chuẩn cho từng phần (theo thiết kế gốc) */
p.hero-desc {
    margin: 0 !important; 
    /* Code cũ là margin: 0, nên ở đây set lại cho chắc */
}

p.card-category {
    margin-bottom: 12px !important; 
    /* Code cũ cách dưới 12px */
}

p.card-desc {
    margin-bottom: 20px !important; 
    /* Code cũ cách dưới 20px */
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    background: #2d3138;
    color: #fff;
    padding: 7px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    width: fit-content;
}

.btn-card-action:hover {
    background: #000;
}

.btn-icon {
    background: #fff;
    color: #1a1a1a;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}


/* =========================================
   RESPONSIVE MOBILE (FINAL - CHUẨN Y CHANG ẢNH 1)
   ========================================= */
@media (max-width: 991px) {

    /* 1. KHUNG CHÍNH */
    .home-hero-section {
        height: auto;
        min-height: 100vh; /* Đảm bảo full màn hình */
        /* Padding trên lớn để tránh header viên thuốc, padding dưới để thoáng */
        padding: 100px 20px 40px 20px; 
        align-items: flex-start;
        display: flex;
    }

    .hero-container {
        flex-direction: column;
        justify-content: flex-start;
        gap: 30px; /* Khoảng cách giữa 3 phần: Title - Slider - Bottom */
        padding: 0;
        width: 100%;
        max-width: 100%;
    }

    /* --- PHẦN 1: TIÊU ĐỀ (TOP) --- */
    /* Để wrapper hiển thị dạng contents để ta dễ order lại */
    .hero-text-wrapper { display: contents; }

    .hero-title {
        order: 1; /* Lên đầu tiên */
        width: 100%;
        font-size: 38px; /* Chữ to như mẫu */
        font-weight: 700;
        line-height: 1.1;
        color: #fff;
        margin-bottom: 0;
        text-align: left;
    }

    /* --- PHẦN 2: SLIDER (GIỮA) --- */
    .hero-slider-structure {
        order: 2; /* Nằm giữa */
        width: 100%;
        margin: 0; 
        padding: 0;
        transform: none; /* Bỏ các hiệu ứng lệch của desktop */
        position: relative;
    }

    /* NÚT MŨI TÊN TRẮNG TRÒN (Giống mẫu) */
    .hero-nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px; 
        height: 40px;
        background: #fff; /* Nền trắng */
        color: #1a1a1a;   /* Mũi tên đen */
        border-radius: 50%;
        border: none;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2); /* Đổ bóng cho nổi */
        z-index: 10;
        display: flex; align-items: center; justify-content: center;
    }

    /* Đẩy nút ra sát mép màn hình (hơi chờm ra ngoài card 1 xíu) */
    .hero-nav-btn.prev { left: -10px; }
    .hero-nav-btn.next { right: -10px; }
    
    .hero-nav-btn svg { width: 16px; height: 16px; stroke-width: 2.5px; }

    /* Card Slide */
    .hero-viewport {
        width: 100%;
        border-radius: 20px;
        overflow: hidden;
        /* Không che khuất nút bấm */
        -webkit-mask-image: none; 
    }
    
    .hero-card {
        padding: 20px;
        min-height: auto; /* Để chiều cao tự động theo nội dung */
    }

    /* Ảnh trong card */
    .card-img {
        height: 160px; /* Chiều cao ảnh vừa phải */
        border-radius: 12px;
        margin-bottom: 15px;
    }
    
    .card-title { font-size: 20px; margin-bottom: 0; }
    .card-desc { font-size: 13px; -webkit-line-clamp: 3; margin-bottom: 15px; }


    /* --- PHẦN 3: BOTTOM INFO (CUỐI) --- */
    .hero-bottom-info {
        order: 3; /* Xuống cuối cùng */
        width: 100%;
        margin-top: 10px;
    }

    /* Group: Icon vàng + Chữ tiêu đề nằm ngang */
    .hero-highlight {
        display: flex;
        align-items: center; /* Căn giữa dọc */
        gap: 15px;
        margin-bottom: 15px;
        width: 100%;
    }

    .highlight-icon {
        width: 42px; 
        height: 42px;
        min-width: 42px; /* Không bị bóp méo */
        background: #faff00;
        border-radius: 50%;
        color: #000;
        display: flex; align-items: center; justify-content: center;
    }
    
    .highlight-text {
        font-size: 30px;
        line-height: 1.3;
        font-weight: 200;
        color: #fff;
        margin: 0;
        flex: 1; /* Chữ chiếm hết phần còn lại */
    }
    
    /* Ẩn thẻ br trên mobile để chữ tự xuống dòng tự nhiên */
    .highlight-text br { display: none; }

    /* Dòng mô tả màu xám nằm dưới cùng */
    .hero-desc {
        font-size: 14px;
        color: #9ca3af;
        line-height: 1.5;
        margin: 0;
        padding-left: 0; /* Thẳng hàng lề trái */
    }
}

/* =========================================
   CINEMATIC ENTRANCE (2 KHỐI LAO VÀO TỪ 2 BÊN)
   ========================================= */

/* 1. Quan trọng: Ẩn thanh cuộn ngang khi các khối chạy từ ngoài vào */
body, html {
    overflow-x: hidden;
}

/* 2. Định nghĩa chuyển động cho Cột Trái (Text) */
@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px); /* Xuất phát từ bên trái 100px */
    }
    100% {
        opacity: 1;
        transform: translateX(0); /* Về vị trí chuẩn */
    }
}

/* 3. Định nghĩa chuyển động cho Cột Phải (Slider) - DESKTOP */
/* Lưu ý: Desktop đang có transform: translateX(30px) nên phải kết thúc ở 30px */
@keyframes slideInFromRightDesktop {
    0% {
        opacity: 0;
        transform: translateX(150px); /* Xuất phát tít bên phải */
    }
    100% {
        opacity: 1;
        transform: translateX(30px); /* Về vị trí lệch phải 30px như thiết kế cũ */
    }
}

/* 4. Định nghĩa chuyển động cho Cột Phải (Slider) - MOBILE */
@keyframes slideInFromRightMobile {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0); /* Mobile thì về 0 */
    }
}


/* --- ÁP DỤNG --- */

/* Khối bên trái (Text + Icon) chạy vào trước */
.hero-text-wrapper {
    opacity: 0; /* Ẩn trước khi chạy */
    /* Dùng cubic-bezier để tạo đà: Nhanh ở đầu, phanh gấp ở cuối cho mượt */
    animation: slideInFromLeft 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Khối bên phải (Slider) chạy vào sau 1 chút */
.hero-slider-structure {
    opacity: 0; 
    /* Mặc định Desktop */
    animation: slideInFromRightDesktop 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.2s; /* Chạy sau bên trái 0.2s cho có nhịp điệu */
}

/* --- XỬ LÝ RIÊNG CHO MOBILE --- */
@media (max-width: 991px) {
    .hero-slider-structure {
        /* Mobile dùng animation khác để không bị lệch */
        animation-name: slideInFromRightMobile; 
    }
}

/* Đảm bảo các phần tử con hiển thị bình thường (Reset code cũ nếu có) */
.hero-title, .hero-highlight, .hero-desc {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}