/* ==========================================================
   1. KHUNG BANNER CĂN GIỮA MÀN HÌNH (MID-POPUP)
   ========================================================== */
.mid-popup-wrapper {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 2147483647 !important;
  background-color: #fd0100;
  padding: 5px !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  box-sizing: border-box !important;
  pointer-events: auto !important;
  width: 90% !important;
  max-width: 770px !important;
}

.popup-banner-container {
  display: flex !important;
  gap: 5px !important;
  width: 100% !important;
}

.popup-banner-item {
  display: block !important;
  text-decoration: none !important;
}

.popup-banner-item img {
  display: block !important;
  max-width: 250px;
  height: 250px !important;
  object-fit: cover !important;
  border-radius: 4px !important;
}

/* NÚT TẮT DẠNG SPAN CỰC DỄ BẤM CHO POPUP */
.close-popup-btn {
  position: absolute !important;
  top: -10px !important;
  right: -10px !important;
  width: 25px !important;
  height: 25px !important;
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  border-radius: 50% !important;
  font-size: 15px !important;
  font-weight: bold !important;
  line-height: 20px !important;
  text-align: center !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
  z-index: 2147483647 !important;
  pointer-events: auto !important;
  
  user-select: none !important;
  -webkit-user-select: none !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}


/* ==========================================================
   2. CẤU HÌNH BANNER CỐ ĐỊNH (TOP & BOTTOM BANNER)
   ========================================================== */
.banner-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 99999;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.banner-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5px;
  display: flex;
  gap: 5px;
  box-sizing: border-box;
}

.banner-container img {
  display: block;
  width: 550px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.banner-item {
  display: block;
  text-decoration: none;
  overflow: visible;
}

.banner-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
}

/* KHU VỰC CHỨA NÚT TẮT Ở BANNER THỨ 3 */
.banner-last {
  position: relative;
}

/* ĐỊNH DẠNG NÚT TẮT CHUNG CHO BANNER */
.close-banner-btn {
  position: absolute;
  width: 15px;
  height: 15px;
  background-color: #000000;
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
  z-index: 10;
}

/* Vị trí nút tắt cho TOP BANNER (Căn giữa phía dưới) */
.banner-wrapper:not(.is-bottom) .banner-last .close-banner-btn {
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  top: auto;
}

/* Cấu hình KHI LÀ CATFISH BOTTOM BANNER (`.is-bottom`) */
.banner-wrapper.is-bottom {
  top: auto;
  bottom: 0;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.15);
}

/* Vị trí nút tắt cho CATFISH BANNER (Căn giữa phía trên mép ảnh) */
.banner-wrapper.is-bottom .banner-last .close-banner-btn {
  top: 0px;
  left: 50%;
  transform: translate(-50%, -50%);
  right: auto;
  bottom: auto;
}


/* ==========================================================
   3. RESPONSIVE LAYOUT (THIẾT BỊ DI ĐỘNG & MÁY TÍNH BẢNG)
   ========================================================== */

/* Trên Desktop (>= 768px) */
@media (min-width: 768px) {
  .banner-container {
    flex-direction: row;
    align-items: center;
  }
  
  .banner-item {
    flex: 1;
  }
}

/* Trên Mobile & Tablet (< 768px) */
@media (max-width: 767px) {
  /* Popup Responsive */
  .mid-popup-wrapper {
    width: 90% !important;
    max-width: 280px !important;
  }

  .popup-banner-item img {
    display: block !important;
    max-width: 90px;
    height: auto !important;
    object-fit: cover !important;
    border-radius: 4px !important;
  }

  .popup-banner-item {
    width: 100% !important;
  }

  /* Banner Responsive */
  .banner-container {
    flex-direction: column;
    align-items: center;
  }

  .banner-item {
    width: 100%;
    max-width: 300px;
  }

  /* Điều chỉnh vị trí nút tắt trên mobile */
  .banner-wrapper.is-bottom .banner-last .close-banner-btn {
    top: -40px !important;
  }

  .banner-wrapper:not(.is-bottom) .banner-last .close-banner-btn {
    bottom: -65px;
  }
}