
.ui-image-swiper-gallery {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    border-radius: 4px;
}

.ui-image-swiper-gallery .header {
    border-bottom: 2px solid #13439b;
    display: inline-block;
    height: 32px;
    list-style: outside none none;
    margin: 0 0 5px;
    padding: 0;
    position: relative;
    width: 100%;
    background: #13439b;
}

.ui-image-swiper-gallery .header .text {
   text-transform: uppercase;        
    display: inline-block;
    background-color: #13439b;
    padding: 0 15px;  
    line-height: 32px;
    color: #fff;    
    font-size: 14px;     
    position: relative;    
    font-weight: 500;
}

/* Container */
.ui-image-swiper-gallery .ui-image-swiper-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

/* Swiper chính - Override thư viện */
.ui-image-swiper-gallery .swiper-container-image {
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto !important; /* Xóa margin mặc định của swiper */
}

/* ============================================
   SLIDES - Fix cho slidesPerView: "auto"
   ============================================ */
.ui-image-swiper-gallery .swiper-slide {
    /* QUAN TRỌNG: Với slidesPerView: "auto", phải set width cố định */
    width: 100% !important;
    max-width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    
    /* Fix cho centeredSlides: true khi chỉ có 1 slide nhìn thấy */
    flex-shrink: 0; /* Ngăn slide co lại */
}

/* Kiểm tra nếu swiper tính sai kích thước */
.ui-image-swiper-gallery .swiper-wrapper {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================
   IMAGE - Constraint trong khung hẹp
   ============================================ */
.ui-image-swiper-gallery .gallery-img__wrapper {
    width: 100%;
    height: auto; /* Hoặc aspect-ratio: 4/3 nếu muốn linh hoạt hơn */
    /* background: #000; */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.ui-image-swiper-gallery .gallery-img {
    max-width: 100%;
    max-height: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    /* Ngăn ảnh làm slide giãn ra khi slidesPerView: auto */
    flex-shrink: 0;
}

/* ============================================
   CAPTION - Xử lý text dài
   ============================================ */
.ui-image-swiper-gallery .gallery-info__wrapper {
    width: 100%;
    /* padding: 6px; */
    /* background: #fff; */
    /* border-top: 1px solid #eee; */
    box-sizing: border-box;
    min-height: 60px;
    margin-top: 6px;
}

.ui-image-swiper-gallery .heading-medium {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    
    /* Xử lý text song ngữ dài */
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* display: -webkit-box; */
    /* -webkit-line-clamp: 3; */
    /* -webkit-box-orient: vertical; */
    /* overflow: hidden; */
    /* text-overflow: ellipsis; */
}

/* ============================================
   PAGINATION
   ============================================ */
.ui-image-swiper-gallery .swiper-pagination {
    position: absolute;
    width: 100%;
    /* margin-top: 8px; */
    /* padding-bottom: 8px; */
    display: flex;
    justify-content: center;
    gap: 4px;
}

.ui-image-swiper-gallery .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background: #bbb;
    opacity: 1;
}

.ui-image-swiper-gallery .swiper-pagination-bullet-active {
    background: #c00;
}