/* assets/css/frontend.css */

/* =========================================
   1. CẤU HÌNH KHOẢNG THỤT MẶC ĐỊNH
   ========================================= */
:root {
    --mfs-indent: 20px; 
}
@media (min-width: 768px) { :root { --mfs-indent: 20vw; } }
@media (min-width: 1024px) { :root { --mfs-indent: 14vw; } }

/* =========================================
   2. CONTAINER CHÍNH
   ========================================= */
.mfs-wrapper {
    width: 100%;
    margin: 60px 0;
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* =========================================
   3. HEADER (DESKTOP)
   ========================================= */
.mfs-header {
    width: 100%; 
    max-width: none; 
    margin: 0 0 40px 0;
    /* Indent này được tính toán bởi JS hoặc CSS Var */
    padding-left: var(--mfs-indent); 
    padding-right: 5vw;
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    flex-wrap: wrap; 
    gap: 20px; 
    box-sizing: border-box;
}

.mfs-header-content { max-width: 600px; }

/* Title & Description */
.mfs-title { 
    font-weight: var(--mfs-main-title-weight, 700) !important; 
    margin: 0 0 20px 0; 
    line-height: 1.1;
    color: var(--mfs-main-title-color, #111) !important;
    font-size: var(--mfs-main-title-size, 42px) !important;
}

.mfs-desc { 
    font-weight: var(--mfs-main-desc-weight, 400) !important;
    margin: 0; 
    line-height: 1.5;
    color: var(--mfs-main-desc-color, #555) !important;
    font-size: var(--mfs-main-desc-size, 18px) !important;
}

.mfs-nav-container { display: flex; gap: 12px; }

/* Buttons */
.mfs-button-prev, .mfs-button-next {
    width: 48px; height: 48px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; cursor: pointer; 
    transition: all 0.3s ease; z-index: 20;
    background: var(--mfs-nav-btn-bg, #fff);
    color: var(--mfs-nav-btn-color, #111);
    border: 1px solid var(--mfs-nav-btn-bg, #ddd); 
}
.mfs-button-prev:hover, .mfs-button-next:hover {
    background: var(--mfs-nav-btn-bg-hover, #111);
    color: var(--mfs-nav-btn-color-hover, #fff);
    border-color: var(--mfs-nav-btn-bg-hover, #111);
}

/* =========================================
   4. SLIDER AREA
   ========================================= */
.mfs-slider-container { width: 100%; position: relative; height: 550px; padding: 0; z-index: 10; }
.mfs-swiper { width: 100%; height: 100%; padding-left: var(--mfs-indent); overflow: visible !important; box-sizing: border-box; display: block; }
.swiper-wrapper { position: relative; width: 100%; height: 100%; z-index: 1; display: flex; transition-property: transform; box-sizing: content-box; }
.swiper-slide { flex-shrink: 0; width: 100%; height: 100%; max-height: 480px; position: relative; transition-property: transform; border-radius: 0; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }

/* =========================================
   5. CARD STYLE
   ========================================= */
.mfs-card { display: block; width: 100%; height: 100%; position: relative; text-decoration: none; overflow: hidden; border-radius: 0; }

.mfs-card-bg { 
    width: 100%; height: 100%; 
    background-size: cover; background-position: center center; background-repeat: no-repeat; 
    background-color: #333; 
    transition: transform 0.6s ease; 
}
.mfs-card:hover .mfs-card-bg { transform: scale(1.08); }

.mfs-card-content { 
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 30px; 
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 60%, transparent 100%); 
    z-index: 2; pointer-events: none; box-sizing: border-box;
}

.mfs-card-title { 
    font-weight: var(--mfs-card-title-weight, 700) !important; 
    margin: 0 0 10px 0; line-height: 1.3; 
    color: var(--mfs-card-title-color, #fff) !important;
    font-size: var(--mfs-card-title-size, 24px) !important;
}

.mfs-card-text { 
    font-weight: var(--mfs-card-text-weight, 400) !important;
    display: block; margin: 0; line-height: 1.5; text-align: justify;
    color: var(--mfs-card-text-color, #e0e0e0) !important;
    font-size: var(--mfs-card-text-size, 16px) !important;
}

/* =========================================
   6. RESPONSIVE MOBILE FIX (MAX-WIDTH: 767px)
   ========================================= */
@media (max-width: 767px) {
    .mfs-wrapper { margin: 40px 0; }
    
    /* 1. Reset Header Layout */
    .mfs-header { 
        display: block; /* Xếp chồng dọc */
        /* [FIX QUAN TRỌNG] Reset Padding về 20px, ghi đè mọi JS tính toán */
        padding-left: 20px !important; 
        padding-right: 20px !important;
        margin-bottom: 20px;
    }
    
    .mfs-header-content {
        width: 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }

    /* 2. Fix Cỡ chữ Mobile (Ghi đè size Desktop) */
    .mfs-title { 
        font-size: var(--mfs-main-title-size-mobile, 32px) !important; 
        margin-bottom: 10px;
    }
    
    .mfs-desc {
        font-size: var(--mfs-main-desc-size-mobile, 16px) !important; 
    }

    /* 3. Nút điều hướng Mobile */
    .mfs-nav-container { 
        margin-top: 15px; 
        justify-content: flex-start; /* Canh trái thẳng hàng text */
    }
    
    /* 4. Fix Slider Container */
    .mfs-slider-container { 
        height: 400px; 
    }
    
    .mfs-swiper {
        /* Reset padding slider về 20px để thẳng hàng Header */
        padding-left: 20px !important; 
        padding-right: 20px !important; /* Thêm padding phải để lộ 1 phần slide sau */
    }

    .swiper-slide { 
        max-height: 340px; 
        width: 80%; /* Slide mobile nên chiếm 80% để người dùng biết còn slide sau */
    }
    
    .mfs-card-content { padding: 20px; }
    
    /* Fix font trong card trên mobile */
    .mfs-card-title { font-size: var(--mfs-card-title-size-mobile, 20px) !important; }
    .mfs-card-text { font-size: var(--mfs-card-text-size-mobile, 14px) !important; }
}