/* ==========================================================================
   An Gia – kêu gọi hành động (CTA): nút, khối CTA trong bài, form báo giá,
   nút liên hệ nổi (plugin Call By Vinasite) và thanh liên hệ trên điện thoại.
   ========================================================================== */

/* ---------- Nút CTA ---------- */
.ag-cbtns { display: flex; flex-wrap: wrap; gap: 10px; }
.ag-site .ag-cbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; font-family: var(--ag-font-head); font-size: 15px; font-weight: 700; line-height: 1.2; text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s; white-space: nowrap;
}
.ag-site .ag-cbtn:hover { transform: translateY(-2px); text-decoration: none; }
.ag-cbtn .ag-ico { width: 18px; height: 18px; flex: none; }
.ag-site .ag-cbtn--call { background: linear-gradient(135deg, var(--ag-gold), var(--ag-gold-2)); color: var(--ag-800); box-shadow: 0 8px 20px rgba(201, 161, 74, .35); }
.ag-site .ag-cbtn--call:hover { color: var(--ag-800); box-shadow: 0 12px 26px rgba(201, 161, 74, .45); }
.ag-site .ag-cbtn--zalo { background: #0068ff; color: #fff; box-shadow: 0 8px 20px rgba(0, 104, 255, .25); }
.ag-site .ag-cbtn--zalo:hover { background: #0057d6; color: #fff; }
.ag-site .ag-cbtn--quote { background: #fff; color: var(--ag-700); border: 1.5px solid var(--ag-700); }
.ag-site .ag-cbtn--quote:hover { background: var(--ag-700); color: #fff; }

/* ---------- [ag_cta type="top"]: thanh gọn trong bài ---------- */
.entry-content .ag-cta-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px;
  margin: 8px 0 30px; padding: 20px 24px; border-radius: 16px; background: var(--ag-50); border: 1px solid #d5e6db; border-left: 4px solid var(--ag-gold);
}
.ag-cta-bar__title { font-family: var(--ag-font-head); font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--ag-800); }
.ag-cta-bar__sub { margin-top: 4px; font-size: 15.5px; color: var(--ag-muted); }

/* ---------- [ag_cta type="box"]: khối nền xanh ---------- */
.entry-content .ag-cta-box {
  position: relative; overflow: hidden; margin: 10px 0 34px; padding: 30px 32px; border-radius: 20px; color: #fff;
  background: radial-gradient(500px 220px at 100% 0%, rgba(227, 189, 102, .25), transparent 60%), linear-gradient(120deg, var(--ag-800), var(--ag-700));
  box-shadow: 0 18px 40px rgba(7, 59, 36, .22);
}
.entry-content .ag-cta-box::after { content: ""; position: absolute; right: -70px; bottom: -90px; width: 240px; height: 240px; border-radius: 50%; border: 1px solid rgba(227, 189, 102, .3); pointer-events: none; }
.ag-cta-box__text { position: relative; z-index: 1; margin-bottom: 18px; }
.ag-cta-box__title { font-family: var(--ag-font-head); font-size: 22px; font-weight: 700; line-height: 1.3; color: #fff; }
.ag-cta-box__sub { margin-top: 6px; font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .85); }
.ag-cta-box .ag-cbtns { position: relative; z-index: 1; }
.ag-site .ag-cta-box .ag-cbtn--quote { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.ag-site .ag-cta-box .ag-cbtn--quote:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------- [ag_cta type="form"]: khối báo giá có form ---------- */
.entry-content .ag-cta-form {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start;
  margin: 10px 0 34px; padding: 30px; border-radius: 20px; background: #fff; border: 1px solid #d5e6db;
  box-shadow: 0 18px 44px rgba(7, 59, 36, .12); scroll-margin-top: 96px;
}
.ag-cta-form__kicker { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ag-gold); }
.ag-cta-form__title { margin: 6px 0 8px; font-family: var(--ag-font-head); font-size: 23px; font-weight: 700; line-height: 1.3; color: var(--ag-800); }
.entry-content .ag-cta-form__text { margin: 0 0 14px; font-size: 16px; color: #3b4a43; }
.entry-content .ag-cta-form__points { margin: 0 0 18px; padding: 0; list-style: none; }
.entry-content .ag-cta-form__points li { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 9px; padding: 0; list-style: none; font-size: 15.5px; line-height: 1.5; color: var(--ag-ink); }
.ag-cta-form__points .ag-ico { flex: none; width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--ag-100); color: var(--ag-700); stroke-width: 3; }
.ag-cta-form__alt { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--ag-muted); }
.ag-cta-form__form { padding: 22px; border-radius: 16px; background: var(--ag-50); }
.ag-cta-form__form .wpcf7 input[type="text"], .ag-cta-form__form .wpcf7 input[type="email"], .ag-cta-form__form .wpcf7 input[type="tel"], .ag-cta-form__form .wpcf7 textarea { background: #fff; border-color: #d5e6db; }
.ag-cta-form__form .wpcf7 textarea { height: 110px; }
.ag-cta-form__form .wpcf7 input[type="submit"] { width: 100%; min-height: 52px; font-size: 17px; }

/* ---------- Nút liên hệ nổi (plugin Call By Vinasite) – máy tính ---------- */
#vinasite-call-bottom .box-support { right: 22px !important; left: auto !important; bottom: 84px !important; display: flex; flex-direction: column; gap: 12px; }
#vinasite-call-bottom .box-support a {
  display: grid; place-items: center; width: 54px; height: 54px; margin: 0; border-radius: 50%;
  box-shadow: 0 10px 24px rgba(7, 59, 36, .25); transition: transform .25s, box-shadow .25s;
}
#vinasite-call-bottom .box-support a:hover { transform: scale(1.08); box-shadow: 0 14px 30px rgba(7, 59, 36, .32); }
#vinasite-call-bottom .box-support a img { display: none !important; }
#vinasite-call-bottom .box-support a::before { content: ""; width: 24px; height: 24px; background: #fff; }
#vinasite-call-bottom .box-support a[href^="tel:"] { background: linear-gradient(135deg, var(--ag-700), var(--ag-500)); }
#vinasite-call-bottom .box-support a[href^="tel:"]::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: agRing 2.4s ease-in-out infinite;
}
/* Vòng sóng lan quanh nút gọi */
#vinasite-call-bottom .box-support a[href^="tel:"]::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(30, 138, 70, .55);
  animation: agPulseRing 2s ease-out infinite; pointer-events: none;
}
#vinasite-call-bottom .box-support a[href^="mailto:"] { background: linear-gradient(135deg, var(--ag-gold), var(--ag-gold-2)); }
#vinasite-call-bottom .box-support a[href^="mailto:"]::before {
  background: var(--ag-800);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") center/contain no-repeat;
}
#vinasite-call-bottom .box-support a[href*="zalo.me"] { background: #0068ff; }
#vinasite-call-bottom .box-support a[href*="zalo.me"]::before {
  content: "Zalo"; width: auto; height: auto; background: none; color: #fff;
  font-family: var(--ag-font-head); font-size: 14px; font-weight: 800; letter-spacing: -.01em;
}
/* Nhãn khi rê chuột */
#vinasite-call-bottom .box-support .aml-tooltiptext {
  top: 50%; right: calc(100% + 12px); transform: translateY(-50%); padding: 8px 14px; border-radius: 999px;
  background: var(--ag-800); background-image: none; color: #fff; font-family: var(--ag-font-head); font-size: 13px !important; font-weight: 600;
  line-height: 1.2 !important; box-shadow: 0 8px 20px rgba(7, 59, 36, .25);
}
#vinasite-call-bottom .box-support a[href^="tel:"] .aml-tooltiptext,
#vinasite-call-bottom .box-support a[href^="mailto:"] .aml-tooltiptext { font-size: 0 !important; }
#vinasite-call-bottom .box-support a[href^="tel:"] .aml-tooltiptext::after { content: "Gọi 0971.808.828"; font-size: 13px; }
#vinasite-call-bottom .box-support a[href^="mailto:"] .aml-tooltiptext::after { content: "Gửi email cho An Gia"; font-size: 13px; }
@keyframes agPulseRing { 0% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes agRing { 0%, 50%, 100% { transform: rotate(0); } 5%, 15%, 25% { transform: rotate(-14deg); } 10%, 20% { transform: rotate(14deg); } }

/* ---------- Thanh liên hệ nhanh – điện thoại ---------- */
.ag-mbar { display: none; }
@media (max-width: 849px) {
  #vinasite-call-bottom { display: none !important; }
  body.ag-site { padding-bottom: 66px; }
  .ag-mbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -6px 20px rgba(7, 59, 36, .14);
  }
  .ag-site .ag-mbar__btn {
    display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; border-radius: 12px;
    font-family: var(--ag-font-head); font-size: 14.5px; font-weight: 700; text-decoration: none;
  }
  .ag-mbar__btn .ag-ico { width: 19px; height: 19px; }
  .ag-site .ag-mbar__btn--call { background: linear-gradient(135deg, var(--ag-700), var(--ag-500)); color: #fff; }
  .ag-site .ag-mbar__btn--call .ag-ico { animation: agRing 2.4s ease-in-out infinite; }
  .ag-site .ag-mbar__btn--zalo { background: #0068ff; color: #fff; }
  .ag-site .ag-mbar__btn--quote { background: linear-gradient(135deg, var(--ag-gold), var(--ag-gold-2)); color: var(--ag-800); }

  .entry-content .ag-cta-bar { padding: 18px; }
  .entry-content .ag-cta-box { padding: 24px 20px; }
  .ag-cta-box__title { font-size: 20px; }
  .entry-content .ag-cta-form { grid-template-columns: 1fr; padding: 22px 18px; gap: 18px; }
  .ag-cta-form__form { padding: 16px; }
}
@media (max-width: 549px) {
  .ag-cbtns { flex-direction: column; width: 100%; }
  .ag-site .ag-cbtn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #vinasite-call-bottom .box-support a[href^="tel:"]::before, #vinasite-call-bottom .box-support a[href^="tel:"]::after, .ag-mbar__btn--call .ag-ico { animation: none; }
}

/* Trang đã có form báo giá ([ag_cta type="form"]): ẩn khối CTA mặc định của theme cha cho đỡ trùng */
body:has(#bao-gia) .vs-single__cta { display: none; }
