/* =========================================================
   KP FLOATING — FINAL VIEWPORT
   3 NÚT ĐỘC LẬP HOÀN TOÀN KHỎI GIAO DIỆN
   - Luôn hiển thị trên màn hình
   - Không chạy theo section / footer / video
   - Cuộn trang: vẫn nằm cố định theo viewport
   - PC GIỮ NGUYÊN KÍCH THƯỚC / VỊ TRÍ
   - MOBILE: luôn có đủ 3 nút
   - AI PANEL nằm trên video/nội dung, không bị kéo theo giao diện
   ========================================================= */

/* =========================================================
   RESET RIÊNG CHO FLOATING
   ========================================================= */

.kp-floating{
  position:fixed !important;
  top:50% !important;
  right:24px !important;
  bottom:auto !important;
  left:auto !important;

  width:auto !important;
  height:auto !important;

  margin:0 !important;
  padding:0 !important;

  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;

  gap:10px !important;

  transform:translate3d(0,-50%,0) !important;

  z-index:2147483646 !important;

  visibility:visible !important;
  opacity:1 !important;

  isolation:isolate !important;
  pointer-events:auto !important;

  box-sizing:border-box !important;
}

/* =========================================================
   3 NÚT
   ========================================================= */

.kp-floating .kp-float{
  position:relative !important;

  width:56px !important;
  height:56px !important;
  min-width:56px !important;
  min-height:56px !important;

  flex:0 0 56px !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  margin:0 !important;
  padding:0 !important;

  border:0 !important;
  border-radius:50% !important;

  box-sizing:border-box !important;

  cursor:pointer !important;
  text-decoration:none !important;

  visibility:visible !important;
  opacity:1 !important;

  z-index:1 !important;

  box-shadow:0 7px 18px rgba(0,0,0,.18);

  transition:
    transform .2s ease,
    box-shadow .2s ease;
}

.kp-floating .kp-float:hover{
  transform:scale(1.07);
  box-shadow:0 9px 22px rgba(0,0,0,.25);
}

/* =========================================================
   ĐIỆN THOẠI
   ========================================================= */

.kp-floating .kp-float--phone{
  background:#075dcc !important;
}

.kp-floating .kp-float--phone svg{
  width:29px !important;
  height:29px !important;
  display:block !important;
  fill:#fff !important;
}

/* =========================================================
   ZALO
   ========================================================= */

.kp-floating .kp-float--zalo{
  background:#075dcc !important;
  color:#075dcc !important;
  position:relative !important;
}

.kp-floating .kp-float--zalo::before{
  content:"" !important;

  position:absolute !important;

  width:42px !important;
  height:42px !important;

  top:50% !important;
  left:50% !important;

  transform:translate(-50%,-50%) !important;

  background:#fff !important;
  border-radius:50% !important;

  pointer-events:none !important;
}

.kp-floating .kp-float--zalo span{
  position:relative !important;
  z-index:2 !important;

  font-family:Arial,Helvetica,sans-serif !important;
  font-size:14px !important;
  font-weight:900 !important;
  letter-spacing:-.5px !important;
}

/* =========================================================
   AI NÚT NHỎ
   ========================================================= */

.kp-floating .kp-float--ai{
  width:60px !important;
  height:60px !important;

  min-width:60px !important;
  min-height:60px !important;

  flex:0 0 60px !important;

  background:transparent !important;

  border:0 !important;
  border-radius:50% !important;

  box-shadow:none !important;

  padding:0 !important;

  overflow:visible !important;
}

.kp-floating .kp-float--ai:hover{
  box-shadow:none !important;
}

.kp-floating .kp-float--ai img{
  width:60px !important;
  height:60px !important;

  max-width:none !important;
  max-height:none !important;

  display:block !important;

  object-fit:contain !important;
}

/* =========================================================
   AI PANEL
   ========================================================= */

.kp-ai-panel{
  position:fixed !important;

  top:50% !important;
  right:92px !important;
  bottom:auto !important;
  left:auto !important;

  width:360px !important;
  max-width:calc(100vw - 110px) !important;

  margin:0 !important;
  padding:0 !important;

  z-index:2147483645 !important;

  box-sizing:border-box !important;

  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;

  transform:translate3d(0,-50%,15px) scale(.97) !important;

  transition:
    opacity .25s ease,
    transform .25s ease,
    visibility .25s ease !important;

  isolation:isolate !important;
}

.kp-ai-panel.kp-ai-panel--show{
  opacity:1 !important;
  visibility:visible !important;
  pointer-events:auto !important;

  transform:translate3d(0,-50%,0) scale(1) !important;
}

/* =========================================================
   KHUNG AI
   ========================================================= */

.kp-ai-box{
  position:relative !important;

  width:100% !important;
  max-width:100% !important;

  margin:0 !important;
  padding:0 !important;

  background:#fff !important;

  border:1px solid rgba(7,93,204,.12) !important;
  border-radius:20px !important;

  overflow:hidden !important;

  box-shadow:0 15px 45px rgba(0,0,0,.22) !important;

  box-sizing:border-box !important;
}

/* =========================================================
   NÚT ĐÓNG
   ========================================================= */

.kp-ai-close{
  position:absolute !important;

  top:10px !important;
  right:12px !important;

  width:32px !important;
  height:32px !important;

  margin:0 !important;
  padding:0 !important;

  border:0 !important;
  border-radius:50% !important;

  background:rgba(255,255,255,.92) !important;

  color:#333 !important;

  font-size:25px !important;
  line-height:32px !important;
  text-align:center !important;

  cursor:pointer !important;

  z-index:20 !important;
}

/* =========================================================
   HEADER AI
   ========================================================= */

.kp-ai-head{
  display:flex !important;
  align-items:center !important;

  gap:12px !important;

  padding:18px 48px 16px 18px !important;

  background:linear-gradient(135deg,#075dcc,#0b78e8) !important;

  color:#fff !important;

  box-sizing:border-box !important;
}

.kp-ai-head img{
  width:58px !important;
  height:58px !important;

  max-width:58px !important;
  max-height:58px !important;

  object-fit:contain !important;

  flex:0 0 58px !important;
}

.kp-ai-head strong{
  display:block !important;

  margin:0 !important;

  font-size:16px !important;
  line-height:1.3 !important;
}

.kp-ai-head small{
  display:block !important;

  margin:5px 0 0 !important;

  font-size:12px !important;
  line-height:1.3 !important;

  opacity:.9 !important;
}

/* =========================================================
   NỘI DUNG
   ========================================================= */

.kp-ai-content{
  width:100% !important;

  margin:0 !important;

  padding:20px !important;

  color:#222 !important;

  font-size:15px !important;
  line-height:1.55 !important;

  box-sizing:border-box !important;
}

.kp-ai-content p{
  margin:0 0 12px !important;
}

/* =========================================================
   LỰA CHỌN
   ========================================================= */

.kp-ai-options{
  display:grid !important;

  gap:9px !important;

  margin:15px 0 0 !important;
  padding:0 !important;
}

.kp-ai-options button{
  width:100% !important;

  margin:0 !important;
  padding:11px 14px !important;

  border:1px solid #d9e6f7 !important;
  border-radius:11px !important;

  background:#f7fbff !important;
  color:#075dcc !important;

  font-weight:700 !important;
  text-align:left !important;

  cursor:pointer !important;

  box-sizing:border-box !important;

  transition:
    background .2s ease,
    transform .2s ease !important;
}

.kp-ai-options button:hover{
  background:#eaf3ff !important;
  transform:translateX(2px) !important;
}

/* =========================================================
   MOBILE — <=750px
   ĐÂY LÀ PHẦN QUAN TRỌNG:
   3 NÚT LUÔN TRÊN VIEWPORT
   ========================================================= */

@media screen and (max-width:750px){

  .kp-floating{
    position:fixed !important;

    top:50% !important;
    right:10px !important;
    bottom:auto !important;
    left:auto !important;

    width:auto !important;
    height:auto !important;

    margin:0 !important;
    padding:0 !important;

    gap:8px !important;

    transform:translate3d(0,-50%,0) !important;

    z-index:2147483646 !important;

    display:flex !important;
    flex-direction:column !important;

    visibility:visible !important;
    opacity:1 !important;
  }

  /* PHONE + ZALO */
  .kp-floating .kp-float{
    width:50px !important;
    height:50px !important;

    min-width:50px !important;
    min-height:50px !important;

    flex:0 0 50px !important;

    visibility:visible !important;
    opacity:1 !important;
  }

  .kp-floating .kp-float--phone{
    display:flex !important;
  }

  .kp-floating .kp-float--phone svg{
    width:26px !important;
    height:26px !important;
  }

  /* ZALO */
  .kp-floating .kp-float--zalo{
    display:flex !important;
  }

  .kp-floating .kp-float--zalo::before{
    width:38px !important;
    height:38px !important;
  }

  .kp-floating .kp-float--zalo span{
    font-size:12px !important;
  }

  /* AI */
  .kp-floating .kp-float--ai{
    width:54px !important;
    height:54px !important;

    min-width:54px !important;
    min-height:54px !important;

    flex:0 0 54px !important;

    display:flex !important;

    visibility:visible !important;
    opacity:1 !important;
  }

  .kp-floating .kp-float--ai img{
    width:54px !important;
    height:54px !important;
  }

  /* =======================================================
     AI PANEL MOBILE
     NẰM GIỮA MÀN HÌNH, TRÊN VIDEO / NỘI DUNG
     ======================================================= */

  .kp-ai-panel{
    position:fixed !important;

    top:50% !important;
    left:12px !important;
    right:12px !important;

    bottom:auto !important;

    width:auto !important;
    max-width:none !important;

    margin:0 !important;

    z-index:2147483645 !important;

    transform:
      translate3d(0,-50%,15px)
      scale(.97) !important;
  }

  .kp-ai-panel.kp-ai-panel--show{
    transform:
      translate3d(0,-50%,0)
      scale(1) !important;
  }

  .kp-ai-box{
    width:100% !important;
    border-radius:18px !important;
  }

  .kp-ai-head{
    padding:15px 45px 14px 15px !important;
  }

  .kp-ai-head img{
    width:52px !important;
    height:52px !important;
    max-width:52px !important;
    max-height:52px !important;
    flex-basis:52px !important;
  }

  .kp-ai-content{
    padding:17px !important;
    font-size:14px !important;
  }
}

/* =========================================================
   MOBILE RẤT HẸP
   ========================================================= */

@media screen and (max-width:380px){

  .kp-floating{
    right:8px !important;
  }

  .kp-floating .kp-float{
    width:46px !important;
    height:46px !important;
    min-width:46px !important;
    min-height:46px !important;
    flex-basis:46px !important;
  }

  .kp-floating .kp-float--phone svg{
    width:24px !important;
    height:24px !important;
  }

  .kp-floating .kp-float--zalo::before{
    width:35px !important;
    height:35px !important;
  }

  .kp-floating .kp-float--ai{
    width:50px !important;
    height:50px !important;
    min-width:50px !important;
    min-height:50px !important;
    flex-basis:50px !important;
  }

  .kp-floating .kp-float--ai img{
    width:50px !important;
    height:50px !important;
  }

  .kp-ai-panel{
    left:8px !important;
    right:8px !important;
  }
}

/* =========================================================
   MOBILE — KHÔNG CHO HERO-POINTS CHIẾM CHỖ
   ========================================================= */

@media screen and (max-width:750px){
  .hero-points{
    display:none !important;
  }
}

/* =========================================================
   CHỐNG CÁC STYLE CŨ LÀM ẨN 3 NÚT
   ========================================================= */

@media screen and (max-width:750px){

  .kp-floating .kp-float--phone[style],
  .kp-floating .kp-float--zalo[style],
  .kp-floating .kp-float--ai[style]{
    visibility:visible !important;
  }

  .kp-floating .kp-float--phone:not([aria-hidden="true"]),
  .kp-floating .kp-float--zalo:not([aria-hidden="true"]),
  .kp-floating .kp-float--ai:not([aria-hidden="true"]){
    visibility:visible !important;
  }
}
