/**
 * Homepage ACF - Minimal CSS Override (Bản sửa lỗi ưu tiên - ĐÃ TỐI GIẢN)
 * File: homepage-acf-custom.css
 */

/* ============================================
   DỊCH VỤ - SERVICE SECTION
   ============================================ */
.service .owl-carousel .owl-item {
    float: left;
}
.service .owl-carousel .owl-stage-outer {
    overflow: hidden;
}
.service .owl-service.service-static-grid {
    display: block !important;
    text-align: center;
}
.service .owl-service.service-static-grid .service__item {
    transition: all 0.3s ease;
}
.service .owl-service.service-static-grid .service__item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ============================================
   TIN TỨC - NEWS SECTION - FIX LAYOUT
   ============================================ */

/* Đảm bảo Owl Carousel hoạt động đúng */
.newshome .owl-carousel .owl-item {
    float: left;
}
.newshome .owl-carousel .owl-stage-outer {
    overflow: hidden;
}

/* Card tin tức lớn */
.newshome .tintuc__itembig {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex !important;
    flex-direction: column !important;
}
.newshome .tintuc__itembig:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Khối ảnh */
.newshome .tintuc__imgbig {
    display: block !important;
    visibility: visible !important;
    width: 100%;
    height: 220px !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    background: #f0f0f0;
}

/* Ảnh trong khối ảnh */
.newshome .tintuc__imgbig img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease;
    display: block !important;
    visibility: visible !important;
}
.newshome .tintuc__itembig:hover .tintuc__imgbig img {
    transform: scale(1.05);
}

/* Nội dung */
.newshome .tintuc__innerbig {
    padding: 15px !important;
    margin: 0 !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    max-height: 180px;
}

/* Ngày tháng */
.newshome .tintuc__date {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px !important;
    display: block;
}

/* Tiêu đề - cố định 2 dòng */
.newshome .tintuc__titlebig {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px 0 !important;
    min-height: 45px;
    max-height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.newshome .tintuc__titlebig a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}
.newshome .tintuc__titlebig a:hover {
    color: #d32f2f;
}

/* Mô tả - cố định 3 dòng */
.newshome .tintuc__desc {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0 !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    min-height: 67px;
    max-height: 67px;
}

/* Đảm bảo tất cả items có chiều cao bằng nhau */
.newshome .owl-item {
    display: flex !important;
}
.newshome .owl-item > div {
    width: 100%;
}

/* ============================================
   OWL CAROUSEL - NAVIGATION
   ============================================ */
.owl-theme .owl-nav {
    margin-top: 10px;
    text-align: center;
}
.owl-theme .owl-nav [class*='owl-'] {
    color: #FFF;
    font-size: 14px;
    margin: 5px;
    padding: 4px 7px;
    background: #D6D6D6;
    display: inline-block;
    cursor: pointer;
    border-radius: 3px;
}
.owl-theme .owl-nav [class*='owl-']:hover {
    background: #869791;
    color: #FFF;
    text-decoration: none;
}
.owl-theme .owl-nav .disabled {
    opacity: 0.5;
    cursor: default;
}

/* ============================================
   TEAM MARQUEE
   ============================================ */
.team-marquee-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
}
.team-marquee {
    display: flex;
    animation: marquee 30s linear infinite;
    width: fit-content;
}
.team-marquee:hover {
    animation-play-state: paused;
}
.team-marquee-item {
    flex: 0 0 auto;
    width: 300px;
    padding: 0 15px;
}
.team-marquee-wrapper[style*="overflow: visible"] .team-marquee {
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   SUPPORT MARQUEE
   ============================================ */
.support-marquee-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
}
.support-marquee {
    display: flex;
    animation: marquee-support 25s linear infinite;
    width: fit-content;
}
.support-marquee:hover {
    animation-play-state: paused;
}
.support-marquee-item {
    flex: 0 0 auto;
    width: 350px;
    padding: 0 15px;
}
.support-marquee-wrapper[style*="overflow: visible"] .support-marquee {
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}
@keyframes marquee-support {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   RESPONSIVE - MARQUEE + NEWS
   ============================================ */
@media (max-width: 768px) {
    .team-marquee-item { width: 250px; }
    .team-marquee { animation: marquee 20s linear infinite; }
    .support-marquee-item { width: 280px; }
    .support-marquee { animation: marquee-support 18s linear infinite; }

    /* Tin tức mobile */
    .newshome .tintuc__imgbig {
        height: 200px !important;
    }
    .newshome .tintuc__innerbig {
        min-height: 160px;
        max-height: 160px;
    }
    .newshome .tintuc__titlebig {
        font-size: 15px;
        min-height: 42px;
        max-height: 42px;
    }
    .newshome .tintuc__desc {
        font-size: 13px;
        min-height: 62px;
        max-height: 62px;
    }
}

/* ============================================
   SWIPER SLIDER - RESPONSIVE FIX V3 (NO GAP)
   ============================================ */

.slideSwiper {
    height: auto !important;
    position: relative !important;
    width: 100% !important;
    padding-bottom: 0 !important; /* Bỏ padding-bottom cố định */
}

.slideSwiper .swiper-wrapper {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
}

.slideSwiper .swiper-slide {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
}

.slideSwiper__inner {
    width: 100% !important;
    height: auto !important;
    position: relative !important;
    overflow: hidden !important;
}

/* ẢNH - Tự động điều chỉnh chiều cao */
.slideSwiper__inner img {
    width: 100% !important;
    height: auto !important;
    max-height: 650px !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
}

/* RESPONSIVE HEIGHT */
@media (max-width: 991px) {
    .slideSwiper__inner img {
        max-height: 500px !important;
    }
}
@media (max-width: 767px) {
    .slideSwiper__inner img {
        max-height: 400px !important;
    }
}
@media (max-width: 575px) {
    .slideSwiper__inner img {
        max-height: 300px !important;
    }

    .slideSwiper .swiper-button-prev,
    .slideSwiper .swiper-button-next {
        width: 20px !important;
        height: 20px !important;
    }

    .slideSwiper .swiper-button-next:after,
    .slideSwiper .swiper-button-prev:after {
        font-size: 10px;
    }
}

/* Nút navigation - vị trí */
.slideSwiper .swiper-button-prev,
.slideSwiper .swiper-button-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
}

/* ============================================
   LOGO MOBILE SIZE - CHỈ ÁP DỤNG CHO MOBILE
   ============================================ */

/* Mobile < 992px */
@media (max-width: 991px) {
    .header-mobile img,
    .header-mobile .logo-mobile img,
    .header-mobile .custom-logo,
    .header-mobile img.custom-logo,
    .header-mobile .custom-logo-link img,
    .header-mobile a.logo-mobile img,
    .logo-mobile img,
    .logo-mobile .custom-logo {
        max-height: 80px !important;
        max-width: 150px !important;
        width: auto !important;
        height: auto !important;
        display: block !important;
        margin: 0 auto !important;
        object-fit: contain !important;
    }
}

/* Mobile nhỏ (≤ 575px) */
@media (max-width: 575px) {
    .header-mobile img,
    .header-mobile .logo-mobile img,
    .header-mobile .custom-logo,
    .logo-mobile img {
        max-height: 60px !important;
        max-width: 120px !important;
    }
}

/* Mobile rất nhỏ (≤ 375px) */
@media (max-width: 375px) {
    .header-mobile img,
    .header-mobile .logo-mobile img,
    .header-mobile .custom-logo,
    .logo-mobile img {
        max-height: 40px !important;
        max-width: 100px !important;
    }
}

/* Desktop (≥ 992px) - Giữ nguyên kích thước gốc */
@media (min-width: 992px) {
    .header .logo img,
    .header .custom-logo {
        max-height: none !important;
        max-width: none !important;
        width: auto !important;
        height: auto !important;
    }
}

/* ============================================
   HEADER MOBILE - MÀU NỀN & CƠ BẢN
   ============================================ */

.header-mobile {
    position: relative;
    background: #BA0000 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-mobile__bar {
    position: relative;
    z-index: 100;
}

/* ============================================
   MENU BUTTON - BÊN TRÁI
   ============================================ */

.menu-mobile-toggle {
    background: transparent;
    border: none;
    padding: 8px 12px;
    color: #ffffff !important;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-mobile-toggle:hover,
.menu-mobile-toggle:focus {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    outline: none;
}
.menu-mobile-toggle i {
    font-size: 24px;
    line-height: 1;
    color: #ffffff;
}

/* ============================================
   LOGO MOBILE - STYLE
   ============================================ */

@media (max-width: 991px) {
    .logo-mobile {
        display: inline-block !important;
        max-width: 200px !important;
        transition: transform 0.3s ease;
    }
    .logo-mobile:hover {
        transform: scale(1.05);
    }
}

/* ============================================
   FIX KHOẢNG CÁCH HEADER MOBILE
   ============================================ */

/* Loại bỏ mọi margin/padding dọc ngoài ý muốn + set 20px cho logo */
@media (max-width: 991px) {

    /* Xoá margin/padding tổng quát của header mobile */
    .header-mobile {
        margin: 0 !important;
        padding: 0 !important;
        position: relative;
    }

    .header-mobile__bar,
    .header-mobile .container,
    .header-mobile .container-fluid,
    .header-mobile .row,
    .header-mobile [class*="col-"] {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Xoá margin dọc của mọi phần tử bên trong để tránh bị đội chiều cao */
    .header-mobile * {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Body không có padding-top giả */
    body {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* Logo: CÁCH TRÊN 20px – DƯỚI 20px */
    .header-mobile .logo-mobile {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    .header-mobile .logo-mobile img,
    .header-mobile img.custom-logo {
        margin: 0 auto !important;
        padding: 0 !important;
        display: block !important;
    }

    /* Nếu header cũ còn dùng .toggle thì xoá margin/padding của nó */
    header .toggle {
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: 0 !important;
        line-height: 24px !important;
    }
}
