/*
 * GALLERY SLIDER – UNIVERSAL LIBRARY
 * Prefix: uni-
 */

/* === GLOBAL === */
.uni-gallery-slider {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 20px;
}

.uni-gallery-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

/* === MODE 2: SIMPLE SLIDER (AUTO, NO THUMBS, NO RADIUS) === */
.uni-gallery-slider.uni-type-simple .uni-gallery-layout {
  display: block; 
}

/* Bỏ bo góc cho khung chứa chính */
.uni-gallery-slider.uni-type-simple .uni-gallery-main {
  width: 100%;
  max-width: 100%;
  border-radius: 0; /* Vuông vức */
}

/* Bỏ bo góc cho hình ảnh bên trong */
.uni-gallery-slider.uni-type-simple .uni-gallery-main img {
  border-radius: 0; /* Vuông vức */
}

/* === MODE 1: DEFAULT (WITH THUMBS) === */

/* THUMBS CONTAINER */
.uni-gallery-thumbs {
  flex-shrink: 0;
  width: 110px;
  max-height: 500px;
  position: relative;
  overflow: hidden;
}

.uni-gallery-thumbs .swiper-wrapper { align-items: flex-start; }
.uni-gallery-thumbs .swiper-slide { cursor: pointer; opacity: 0.7; }
.uni-gallery-thumbs .swiper-slide img { width: 100%; height: auto; display: block; border-radius: 6px; }

/* Active Thumb Border */
/* Lưu ý: Màu này lấy theo biến global theme hoặc sửa trực tiếp ở đây */
.uni-gallery-thumbs .swiper-slide-thumb-active { 
    opacity: 1; 
    box-shadow: 0 0 0 2px var(--brand-blue, #7E22CE); /* Dùng biến brand hoặc fallback tím */
    border-radius: 6px; 
}

/* NAV THUMBS */
.uni-thumbs-nav .uni-thumbs-prev,
.uni-thumbs-nav .uni-thumbs-next {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.35); border: none; cursor: pointer; z-index: 5;
}
.uni-thumbs-nav .uni-thumbs-prev { top: 4px; }
.uni-thumbs-nav .uni-thumbs-next { bottom: 4px; }
.uni-thumbs-nav .uni-thumbs-prev::before,
.uni-thumbs-nav .uni-thumbs-next::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 10px; height: 10px; border-top: 2px solid #fff; border-right: 2px solid #fff;
}
.uni-thumbs-nav .uni-thumbs-prev::before { transform: rotate(-135deg); }
.uni-thumbs-nav .uni-thumbs-next::before { transform: rotate(45deg); }

/* MAIN COMMON */
.uni-gallery-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: transparent !important; /* Fix nền đen */
}
.uni-gallery-main .swiper-slide { text-align: center; background: transparent !important; }
.uni-gallery-main .swiper-slide img { width: 100%; height: auto; display: block; border-radius: 10px; }

/* NAV MAIN */
.uni-gallery-main-nav .uni-gallery-prev,
.uni-gallery-main-nav .uni-gallery-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.4); border: none; cursor: pointer; z-index: 10;
}
.uni-gallery-main-nav .uni-gallery-prev { left: 12px; }
.uni-gallery-main-nav .uni-gallery-next { right: 12px; }
.uni-gallery-main-nav .uni-gallery-prev::before,
.uni-gallery-main-nav .uni-gallery-next::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 12px; height: 12px; border-top: 2px solid #fff; border-right: 2px solid #fff;
}
.uni-gallery-main-nav .uni-gallery-prev::before { transform: rotate(-135deg); }
.uni-gallery-main-nav .uni-gallery-next::before { transform: rotate(45deg); }

/* Pagination */
.uni-gallery-pagination {
  position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; z-index: 8;
}
.uni-gallery-pagination .swiper-pagination-bullet { width: 8px; height: 8px; background: #fff; opacity: 0.6; }
/* Active Dot Color */
.uni-gallery-pagination .swiper-pagination-bullet-active { 
    opacity: 1; 
    background: var(--brand-blue, #7E22CE); 
}

/* MOBILE RESPONSIVE */
@media (max-width: 767px) {
  .uni-gallery-layout { flex-direction: column; }
  .uni-gallery-main { order: 1; width: 100%; max-width: 100%; }
  
  /* Chỉ apply cho style mặc định */
  .uni-gallery-slider:not(.uni-type-simple) .uni-gallery-thumbs {
    order: 2; width: 100%; max-height: none;
  }
  .uni-gallery-slider:not(.uni-type-simple) .uni-gallery-thumbs .swiper-wrapper {
    align-items: center;
  }
  .uni-thumbs-nav { display: none; }
}