/* ========== SGDIEN Contact Footer (Frontend – FREE lite) ========== */
/* Version: 2.8.6-lite (mobile bar + desktop hotline filled effects) */

/* ===================================================== */
/*                 Mobile footer bar                     */
/* ===================================================== */

/* Tokens (Mobile bar) */
:root {
  --sgcf-bar-h: 65px;
  --sgcf-safe: env(safe-area-inset-bottom, 0px);
}

/* Ẩn mặc định trên PC, chỉ hiện <= 850px */
#sangiaodienptvn-contact-footer-outer {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100 !important;
  /* tăng lên 9999 nếu bị đè bởi cookie bar */
  bottom: 40px;
  padding-bottom: var(--sgcf-safe);
  display: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#sangiaodienptvn-contact-footer:after {
  content: "";
  position: absolute;
  pointer-events: none;
  /* background-image được thêm bằng PHP */
  background-color: transparent;
  background-position: center top;
  background-repeat: no-repeat;
  background-size: 100%;
  height: calc(var(--sgcf-bar-h) + var(--sgcf-safe));
  width: 100%;
  left: 0;
  bottom: 0;
  z-index: -1;
}

#sangiaodienptvn-contact-footer {
  border-bottom: 15px solid #fff;
  display: flex;
  max-width: 1200px;
  margin: auto;
  position: relative;
  padding-top: 5px;
}

#sangiaodienptvn-contact-footer>a {
  position: relative;
  display: block;
  width: 25%;
  text-align: center;
  padding: 10px 0 0 0;
  color: #665527;
  /* Đổi sang màu Nâu đen cao cấp */
  text-decoration: none;
  touch-action: manipulation;
  transition: all 0.3s ease;
}

#sangiaodienptvn-contact-footer>a:hover {
  transform: translateY(-3px);
}

#sangiaodienptvn-contact-footer span {
  display: block;
}

.sangiaodienptvn-contact-footer-btn-label {
  padding: 0 2px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: #665527;
  /* Nâu đen đồng bộ */
  letter-spacing: 0.3px;
}

#sangiaodienptvn-contact-footer>a img {
  height: 28px;
  width: 28px;
  margin-bottom: 4px;
  /* Ép các icon màu xanh blue cũ sang tone Teal sang trọng */
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Loại bỏ sắc xanh blue của icon Messenger/Zalo nếu người dùng upload ảnh mặc định */
#sangiaodienptvn-contact-footer>a img.zalo-icon,
#sangiaodienptvn-contact-footer>a img:not([src*="phone"]) {
  /* brightness(0.8) sepia(1) hue-rotate(130deg) sẽ tạo tone teal sẫm */
  filter: brightness(0.9) contrast(1.1);
}

/* Nút giữa (Hotline) */
#sangiaodienptvn-contact-footer-btn-center {
  position: relative;
  background: transparent !important;
}

#sangiaodienptvn-contact-footer-btn-center .sangiaodienptvn-contact-footer-btn-label {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
}

#sangiaodienptvn-contact-footer-btn-center .sangiaodienptvn-contact-footer-btn-label>span {
  padding: 2px 10px;
  background-image: linear-gradient(90deg, #1c635b 0%, #0f5048 100%);
  border-radius: 30px;
  color: #fff;
  display: inline-block;
  font-size: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sangiaodienptvn-contact-footer-btn-center-icon {
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  background-image: linear-gradient(135deg, #de3837 0%, #a72a27 100%);
  width: 55px;
  /* Tăng nhẹ kích thước */
  height: 55px;
  border-radius: 50%;
  top: -32px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(222, 56, 55, 0.4);
  border: 3px solid #fff;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sangiaodienptvn-contact-footer-btn-center-icon img {
  max-width: 20px;
  height: auto !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Ripple quanh nút giữa (mobile) */
.phone-vr-circle-fill {
  width: 55px;
  height: 55px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 0 #e0a81a;
  border: 2px solid transparent;
  transition: all .5s;
  animation: zoom 1.5s infinite;
  will-change: box-shadow, transform;
}

@keyframes zoom {
  0% {}

  70% {
    box-shadow: 0 0 0 15px transparent
  }

  100% {
    box-shadow: 0 0 0 0 transparent
  }
}

/* Hiện thanh mobile khi <= 850px */
@media only screen and (max-width: 850px) {
  #sangiaodienptvn-contact-footer-outer {
    display: block;
  }
}

/* Chặn cứng thanh mobile trên desktop (>= 851px) */
@media (min-width: 851px) {
  #sangiaodienptvn-contact-footer-outer {
    display: none !important;
  }
}

/* Safe-area padding nếu trình duyệt hỗ trợ */
@supports (padding: max(0px)) {
  #sangiaodienptvn-contact-footer-outer {
    padding-bottom: max(var(--sgcf-safe), 0px);
  }
}

/* Accessibility */
#sangiaodienptvn-contact-footer a:focus-visible {
  outline: 2px solid rgba(14, 104, 200, .6);
  outline-offset: 2px;
  border-radius: 12px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .phone-vr-circle-fill {
    animation: none !important;
  }
}

/* Giảm va chạm style theme */
#sangiaodienptvn-contact-footer a {
  color: inherit;
  text-decoration: none;
}

/* ===================================================== */
/*           Desktop Hotline (PC button)                 */
/* ===================================================== */

/* Container: height cố định theo size; icon phóng to độc lp */
.sgdh {
  position: fixed;
  bottom: 40px;
  z-index: var(--sgdh-z, 10000);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: var(--sgdh-bg, #ff3b30);
  color: var(--sgdh-color, #fff);
  border-radius: var(--sgdh-radius, 999px);
  -webkit-tap-highlight-color: transparent;
  gap: 10px;
  overflow: visible;
  /* cho icon tràn */
  transition: transform .2s ease, box-shadow .2s ease;
  height: var(--sgdh-bar-h, 40px);
  /* << khóa chiều cao pill */
  line-height: 1;
}

/* Vị trí trái/phải dựa theo biến offset-x */
.sgdh.pos-right {
  right: var(--sgdh-offx, 16px);
  left: auto;
}

.sgdh.pos-left {
  left: var(--sgdh-offx, 16px);
  right: auto;
}

/* Link (padding chỉ ngang để không đổi chiều cao) */
.sgdh .sgdh-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 0 12px;
  /* sẽ override theo size */
}

/* Icon: kích thước theo biến; có thể lớn hơn bar và tràn ra ngoài */
.sgdh .sgdh-icon {
  position: relative;
  flex: 0 0 auto;
  width: var(--sgdh-icon-size, 32px);
  height: var(--sgdh-icon-size, 32px);
  border-radius: 50%;
  overflow: visible;
}

.sgdh .sgdh-icon img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

/* Icon có thể tràn ra ngoài trái nếu muốn */
.sgdh.icon-out .sgdh-icon {
  margin-left: calc(-1 * var(--sgdh-icon-out, 0px));
}

/* Text */
.sgdh .sgdh-text {
  font-weight: 700;
  white-space: nowrap;
  font-size: 14px;
  /* sẽ được tinh chỉnh theo size S/M/L */
}

/* Đổ bóng tùy chọn */
.sgdh.has-shadow {
  box-shadow: 0 15px 28px rgba(0, 0, 0, .18);
}

/* Hover lift */
.sgdh.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .22);
}

/* --- Size preset: set bar height + padding ngang + c chữ; KHÔNG đổi theo icon --- */
.sgdh.size-s {
  --sgdh-bar-h: 34px;
}

.sgdh.size-s .sgdh-link {
  padding: 0 10px;
}

.sgdh.size-s .sgdh-text {
  font-size: 12px;
}

.sgdh.size-m {
  --sgdh-bar-h: 40px;
}

.sgdh.size-m .sgdh-link {
  padding: 0 12px;
}

.sgdh.size-m .sgdh-text {
  font-size: 13px;
}

.sgdh.size-l {
  --sgdh-bar-h: 46px;
}

.sgdh.size-l .sgdh-link {
  padding: 0 14px;
}

.sgdh.size-l .sgdh-text {
  font-size: 14px;
}

/* Ẩn/hiện theo breakpoint */
@media (min-width:851px) {
  #sgdien-desktop-hotline {
    display: flex;
  }
}

@media (max-width:850px) {
  #sgdien-desktop-hotline {
    display: none;
  }

  #sgdien-desktop-hotline.is-mobile-visible {
    display: flex;
  }
}

/* ===================================================== */
/*     Filled Effects quanh ICON (đặc, không vin mỏng)  */
/*  Màu lấy từ --sgdh-effect-color; độc lập với nền bar   */
/* ===================================================== */

/* Nhịp thở */
.sgdh.effect-breath .sgdh-icon::after {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--sgdh-effect-spread, 8px));
  background: var(--sgdh-effect-color, rgba(0, 0, 0, .25));
  border-radius: 50%;
  opacity: .45;
  z-index: 0;
  transform-origin: center;
  animation: sg-breath-fill 1.8s ease-in-out infinite;
}

@keyframes sg-breath-fill {
  0% {
    transform: scale(1);
    opacity: .45;
  }

  50% {
    transform: scale(1.13);
    opacity: .70;
  }

  100% {
    transform: scale(1);
    opacity: .45;
  }
}

/* Ripple */
.sgdh.effect-ripple .sgdh-icon::before,
.sgdh.effect-ripple .sgdh-icon::after {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--sgdh-effect-spread, 8px));
  background: var(--sgdh-effect-color, rgba(0, 0, 0, .25));
  border-radius: 50%;
  z-index: 0;
  opacity: .48;
  transform: scale(1);
  animation: sg-ripple-fill 1.6s ease-out infinite;
}

.sgdh.effect-ripple .sgdh-icon::after {
  animation-delay: .5s;
}

@keyframes sg-ripple-fill {
  0% {
    transform: scale(1);
    opacity: .48;
  }

  70% {
    transform: scale(1.9);
    opacity: 0;
  }

  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

/* Wobble (icon) — hỗ trợ cả .has-wobble (mới) và .effect-wobble (cũ) */
.sgdh.has-wobble .sgdh-icon img,
.sgdh.effect-wobble .sgdh-icon img {
  animation: sg-wobble 1.8s ease-in-out infinite;
  transform-origin: 50% 50%;
}

@keyframes sg-wobble {

  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  10% {
    transform: translateX(-1px) rotate(-4deg);
  }

  20% {
    transform: translateX(1px) rotate(4deg);
  }

  30% {
    transform: translateX(-1px) rotate(-3deg);
  }

  40% {
    transform: translateX(1px) rotate(3deg);
  }

  50% {
    transform: translateX(0) rotate(0deg);
  }
}

/* Tắt hiệu ứng vòng */
.sgdh.effect-none .sgdh-icon::before,
.sgdh.effect-none .sgdh-icon::after {
  content: none !important;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {

  .sgdh.effect-breath .sgdh-icon::after,
  .sgdh.effect-ripple .sgdh-icon::before,
  .sgdh.effect-ripple .sgdh-icon::after,
  .sgdh.has-wobble .sgdh-icon img,
  .sgdh.effect-wobble .sgdh-icon img {
    animation: none !important;
  }
}