/* assets/css/frontend.css */

/* [CÔ LẬP] Thay vì dùng :root (toàn trang), chỉ scope vào class của plugin */
.mfs-wrapper {
    --mfs-indent: 20px; 
}

@media (min-width: 768px) { 
    .mfs-wrapper { --mfs-indent: 20vw; } 
}
@media (min-width: 1024px) { 
    .mfs-wrapper { --mfs-indent: 14vw; } 
}

/* =========================================
   2. CONTAINER CHÍNH
   ========================================= */
.mfs-wrapper {
    width: 100%;
    margin: 60px 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    /* Reset box-sizing để tránh xung đột với theme */
    box-sizing: border-box;
}
.mfs-wrapper * {
    box-sizing: border-box;
}

/* =========================================
   3. HEADER
   ========================================= */
.mfs-header {
    width: 100%; max-width: none; margin: 0 0 40px 0;
    padding-left: var(--mfs-indent); padding-right: 5vw;
    display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px;
}
.mfs-header-content { max-width: 600px; }

.mfs-title { 
    font-weight: 700; margin: 0 0 20px 0; line-height: 1.2;
    color: var(--mfs-main-title-color, #111);
    font-size: var(--mfs-main-title-size, 42px);
}
.mfs-desc { 
    margin: 0; 
    color: var(--mfs-main-desc-color, #555);
    font-size: var(--mfs-main-desc-size, 18px);
}

.mfs-nav-container { display: flex; gap: 12px; }

.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);
    /* [FIX] Reset padding/margin mặc định của theme */
    padding: 0; margin: 0;
}
.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; }

/* [QUAN TRỌNG] Scope CSS Swiper để không bị CSS của plugin khác ghi đè */
.mfs-slider-container .mfs-swiper { 
    width: 100%; height: 100%; 
    padding-left: var(--mfs-indent); 
    overflow: visible !important; 
    display: block; 
    list-style: none; /* Fix lỗi theme thêm bullet point */
    margin: 0;
}
.mfs-slider-container .swiper-wrapper { 
    position: relative; width: 100%; height: 100%; z-index: 1; display: flex; transition-property: transform; box-sizing: content-box; 
    margin: 0; padding: 0;
}
.mfs-slider-container .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); 
    margin: 0; /* Reset margin */
}

/* =========================================
   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; 
}

.mfs-card-title { 
    font-weight: 700; margin: 0 0 10px 0; line-height: 1.3; 
    color: var(--mfs-card-title-color, #fff);
    font-size: var(--mfs-card-title-size, 24px);
}

.mfs-card-text { 
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; 
    overflow: hidden; text-overflow: ellipsis; 
    margin: 0; line-height: 1.5; max-height: 3em; 
    color: var(--mfs-card-text-color, #e0e0e0);
    font-size: var(--mfs-card-text-size, 16px);
}

/* =========================================
   6. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .mfs-slider-container { height: 450px; }
    .mfs-slider-container .swiper-slide { max-height: 380px; }
}
@media (max-width: 768px) {
    .mfs-wrapper { margin: 40px 0; }
    .mfs-header { display: block; padding-right: 20px; }
    .mfs-nav-container { margin-top: 15px; justify-content: flex-end; }
    .mfs-slider-container { height: 400px; }
    .mfs-slider-container .swiper-slide { max-height: 340px; }
    .mfs-card-content { padding: 20px; }
}