/* ============================================================
   EDITOR PREVIEW — hiện như block ngay trên banner, không che trang
============================================================ */
.modal-home-overlay.is-editor-preview {
  position: relative !important;
  inset: unset !important;
  top: unset !important;
  left: unset !important;
  right: unset !important;
  bottom: unset !important;
  background: rgba(22, 25, 37, 0.08) !important;
  display: block !important;
  padding: 32px 16px 16px !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: auto !important;
  transition: none !important;
  border-bottom: 2px dashed rgba(54, 191, 250, 0.4);
}

/* Modal box trong editor: căn giữa, không full screen */
.modal-home-overlay.is-editor-preview .modal-home {
  position: relative !important;
  margin: 0 auto !important;
  max-width: 700px !important;
  transform: none !important;
  opacity: 1 !important;
  transition: none !important;
}

/* Slide thấp hơn trong editor */
.modal-home-overlay.is-editor-preview .modal-home__slide {
  height: 520px !important;
}

/* Ẩn animation closing trong editor */
.modal-home-overlay.is-editor-preview.is-closing .modal-home {
  transform: none !important;
  opacity: 1 !important;
}

/* ============================================================
   EDITOR LABEL — badge phía trên modal
============================================================ */
.modal-home-editor-label {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(22, 25, 37, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px 5px 10px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}

.modal-home-editor-label__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #36bffa;
  flex-shrink: 0;
  animation: editorDotPulse 1.6s ease-in-out infinite;
}

@keyframes editorDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

/* ============================================================
   BOOTSTRAP RESET
============================================================ */
.modal-home-overlay,
.modal-home-overlay * {
  box-sizing: border-box !important;
}

/* ============================================================
   OVERLAY
============================================================ */
.modal-home-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important; left: 0 !important;
  right: 0 !important; bottom: 0 !important;
  background: rgba(22, 25, 37, 0.72);
  z-index: 1055 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.modal-home-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-home-overlay.is-closing {
  opacity: 0;
  visibility: visible;
}

/* ============================================================
   MODAL DIALOG
============================================================ */
.modal-home {
  position: relative;
  width: 100%;
  max-width: 700px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1),
              opacity 0.4s ease;
}

.modal-home-overlay.is-open .modal-home {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-home-overlay.is-closing .modal-home {
  transform: scale(0.94) translateY(16px);
  opacity: 0;
}

/* ============================================================
   LEFT — FULL WIDTH (slide + countdown + close đè lên)
============================================================ */
.modal-home__left {
  position: relative;
  width: 100%;
  flex: 1;
  background: #161925;
  overflow: hidden;
}

/* Ẩn right panel nếu còn trong HTML */
.modal-home__right {
  display: none !important;
}

/* ============================================================
   NÚT ĐÓNG — đè lên ảnh góc trên phải
============================================================ */
.modal-home__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 15px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.modal-home__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   OWL CAROUSEL — SLIDE
============================================================ */
#modalSlider {
  height: 100%;
}

.modal-home__slide {
  position: relative;
  height: 600px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.modal-home__slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -o-object-fit: cover;
  /* Safari: tránh flickering khi scale */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.modal-home__slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22,25,37,0.9) 0%, rgba(22,25,37,0) 55%);
}

.modal-home__caption {
  position: relative;
  z-index: 2;
  padding: 32px 28px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-home__caption .tag {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #36bffa;
  font-weight: 500;
}

.modal-home__caption h3 {
  font-size: 20px;
  margin: 0;
  line-height: 28px;
  color: #fff;
}

/* Owl dots */
.owl-dots {
  position: absolute !important;
  bottom: 14px; left: 0; right: 0;
  text-align: center;
  z-index: 10;
  margin: 0 !important;
}
.owl-dot span {
  background: rgba(255,255,255,0.3) !important;
  width: 7px !important;
  height: 7px !important;
  margin: 0 4px !important;
  border-radius: 4px !important;
  transition: all 0.3s !important;
}
.owl-dot.active span {
  background: #0da8ff !important;
  width: 20px !important;
}

/* ============================================================
   COUNTDOWN — đè lên ảnh góc dưới phải (trên dots)
============================================================ */
.modal-home__countdown {
  position: absolute;
  bottom: 48px;
  right: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(22, 25, 37, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
}

.modal-home__ring {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.modal-home__ring svg { display: block; }

.modal-home__ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.modal-home__countdown-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.modal-home__countdown-label b {
  color: #fff;
  font-weight: 600;
}

/* ============================================================
   RESPONSIVE — TABLET ≤ 768px
============================================================ */
@media (max-width: 768px) {
  .modal-home {
    max-width: 520px;
  }

  .modal-home__slide {
    height: 400px;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE ≤ 480px → FULL SCREEN
============================================================ */
@media (max-width: 480px) {
  .modal-home-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 16px !important;
    align-items: center !important;
    justify-content: center !important;
  }

.modal-home {
    width: 92% !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5) !important;
    transform: scale(0.92) translateY(20px) !important;
    opacity: 0 !important;
  }

  .modal-home-overlay.is-open .modal-home {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
  }

  .modal-home-overlay.is-closing .modal-home {
    transform: scale(0.94) translateY(16px) !important;
    opacity: 0 !important;
  }

   .modal-home__left {
    min-height: unset;
  }

  .modal-home__slide {
    height: 65vw;
    min-height: 260px;
    max-height: 400px;
  }

  .modal-home__countdown {
    bottom: 50px;
    right: 16px;
  }
}

/* ============================================================
   LARGE ≥ 1200px
============================================================ */
@media (min-width: 1200px) {
  .modal-home {
    max-width: 800px;
  }

  .modal-home__slide {
    height: 620px;
  }
}
