/* ==========================================================================
   SHARED VISUAL EFFECTS & SVG MICRO-ANIMATIONS (STOREFRONT + ADMIN PREVIEW)
   ========================================================================== */

@property --tg-shop-border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes tgShopBorderRun {
  from { --tg-shop-border-angle: 0deg; }
  to   { --tg-shop-border-angle: 360deg; }
}

@keyframes tgMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Thematic Hero Category Icon Micro-Animations */
.hcm-anim-drip-drop {
  transform-box: fill-box;
  transform-origin: center top;
  animation: hcmDripDrop calc(2.6s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}
.hcm-anim-drip-ripple {
  transform-box: fill-box;
  transform-origin: center;
  animation: hcmDripRipple calc(2.6s / var(--ef-hero-spd, 1)) ease-out infinite;
}
.hcm-anim-drip-glint {
  animation: hcmCorePulse calc(2.6s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}
.hcm-anim-spray-head {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: hcmSprayHead calc(2.1s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}
.hcm-anim-spray-stream {
  animation: hcmSprayFlow calc(1.15s / var(--ef-hero-spd, 1)) linear infinite;
}
.hcm-anim-spray-stream--fast {
  animation-duration: calc(0.88s / var(--ef-hero-spd, 1));
}
.hcm-anim-spray-mist {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: hcmSprayMist calc(1.5s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}
.hcm-anim-pipe-coil {
  transform-box: fill-box;
  transform-origin: center;
  animation: hcmPipeBob calc(3s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}
.hcm-anim-pipe-ring {
  animation: hcmPipeFlow calc(1.65s / var(--ef-hero-spd, 1)) linear infinite;
}
.hcm-anim-pipe-ring--d2 { animation-delay: calc(-0.55s / var(--ef-hero-spd, 1)); }
.hcm-anim-pipe-ring--d3 { animation-delay: calc(-1.1s / var(--ef-hero-spd, 1)); }
.hcm-anim-pipe-core {
  animation: hcmCorePulse calc(2.4s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}
.hcm-anim-fit-l { animation: hcmFitL calc(2.8s / var(--ef-hero-spd, 1)) ease-in-out infinite; }
.hcm-anim-fit-r { animation: hcmFitR calc(2.8s / var(--ef-hero-spd, 1)) ease-in-out infinite; }
.hcm-anim-fit-b { animation: hcmFitB calc(2.8s / var(--ef-hero-spd, 1)) ease-in-out infinite; }
.hcm-anim-fit-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: hcmFitCore calc(2.8s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}
.hcm-anim-agri-leaf-l {
  transform-box: fill-box;
  transform-origin: right bottom;
  animation: hcmAgriLeafL calc(3.2s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}
.hcm-anim-agri-leaf-r {
  transform-box: fill-box;
  transform-origin: left bottom;
  animation: hcmAgriLeafR calc(3.2s / var(--ef-hero-spd, 1)) ease-in-out calc(-0.35s / var(--ef-hero-spd, 1)) infinite;
}
.hcm-anim-agri-spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: hcmAgriSpark calc(2.4s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}
.hcm-anim-timer-hand {
  transform-origin: 24px 30px;
  animation: hcmTimerSpin calc(6s / var(--ef-hero-spd, 1)) linear infinite;
}
.hcm-anim-timer-lcd {
  animation: hcmCorePulse calc(2.2s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}
.hcm-anim-shop-bag {
  transform-box: fill-box;
  transform-origin: center top;
  animation: hcmShopSwing calc(3s / var(--ef-hero-spd, 1)) ease-in-out infinite;
}

@keyframes hcmDripDrop {
  0%, 100% { transform: translateY(-1.4px) scale(0.96, 1.03); }
  42% { transform: translateY(1.2px) scale(1.03, 0.96); }
  64% { transform: translateY(2.2px) scale(1.06, 0.92); }
  82% { transform: translateY(-0.5px) scale(0.99, 1.01); }
}
@keyframes hcmDripRipple {
  0%, 46% { transform: scaleX(0.32); opacity: 0; }
  65% { transform: scaleX(0.88); opacity: 0.72; }
  95%, 100% { transform: scaleX(1.26); opacity: 0; }
}
@keyframes hcmSprayHead {
  0%, 100% { transform: scaleX(1); }
  45% { transform: scaleX(0.88) scaleY(1.05); }
  75% { transform: scaleX(1.04); }
}
@keyframes hcmSprayFlow {
  0% { stroke-dashoffset: 0; opacity: 0.95; }
  50% { opacity: 0.65; }
  100% { stroke-dashoffset: -12; opacity: 0.95; }
}
@keyframes hcmSprayMist {
  0%, 100% { transform: translateY(0.8px) scale(0.92); opacity: 0.72; }
  55% { transform: translateY(-2.4px) scale(1.09); opacity: 1; }
}
@keyframes hcmPipeBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1.8px) scale(1.025); }
}
@keyframes hcmPipeFlow {
  0% { stroke-dashoffset: 0; opacity: 0.65; }
  50% { opacity: 0.95; }
  100% { stroke-dashoffset: -20; opacity: 0.65; }
}
@keyframes hcmCorePulse {
  0%, 100% { opacity: 0.68; }
  50% { opacity: 1; }
}
@keyframes hcmFitL {
  0%, 20%, 82%, 100% { transform: translateX(-1.4px); }
  46%, 60% { transform: translateX(0.8px); }
}
@keyframes hcmFitR {
  0%, 20%, 82%, 100% { transform: translateX(1.4px); }
  46%, 60% { transform: translateX(-0.8px); }
}
@keyframes hcmFitB {
  0%, 20%, 82%, 100% { transform: translateY(1.4px); }
  46%, 60% { transform: translateY(-0.8px); }
}
@keyframes hcmFitCore {
  0%, 22%, 100% { transform: scale(0.86); opacity: 0.78; }
  52% { transform: scale(1.28); opacity: 1; }
}
@keyframes hcmAgriLeafL {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(-6deg) scale(1.05); }
}
@keyframes hcmAgriLeafR {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(6deg) scale(1.06); }
}
@keyframes hcmAgriSpark {
  0%, 100% { transform: scale(0.75); opacity: 0.55; }
  50% { transform: scale(1.28); opacity: 1; }
}
@keyframes hcmTimerSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes hcmShopSwing {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

/* Footer Hotline Pill & Social CTA Animations */
.tgf-phone-pill {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 1.5px solid var(--ef-hotline-bdr, rgba(250, 224, 130, 0.78));
  border-radius: 99px;
  padding: 7px 18px 7px 8px;
  background: linear-gradient(
    135deg,
    rgba(var(--ef-hotline-rgb, 234, 179, 8), 0.28) 0%,
    rgba(var(--ef-hotline2-rgb, 52, 211, 153), 0.24) 52%,
    rgba(var(--ef-hotline-rgb, 234, 179, 8), 0.2) 100%
  );
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.3),
    0 0 calc(20px * var(--ef-glow, 1)) rgba(var(--ef-hotline-rgb, 234, 179, 8), calc(0.34 * var(--ef-glow, 1))),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-decoration: none;
  overflow: visible;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  animation: tgfPillBreath calc(2.8s / var(--ef-footer-spd, 1)) ease-in-out infinite;
}
.tgf-phone-pill::before {
  content: '';
  position: absolute;
  inset: -2px;
  padding: 2.2px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--tg-shop-border-angle),
    rgba(255, 255, 255, 0.12) 0deg,
    rgba(var(--ef-hotline-rgb, 253, 224, 71), 0.98) 75deg,
    rgba(var(--ef-hotline2-rgb, 52, 211, 153), 0.95) 135deg,
    rgba(255, 255, 255, 0.12) 185deg,
    rgba(var(--ef-hotline-rgb, 254, 240, 138), 0.98) 265deg,
    rgba(var(--ef-hotline2-rgb, 110, 231, 183), 0.92) 320deg,
    rgba(255, 255, 255, 0.12) 360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: tgShopBorderRun calc(3.4s / var(--ef-footer-spd, 1)) linear infinite;
  pointer-events: none;
  z-index: 2;
}
.tgf-phone-pill__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.tgf-phone-pill__shine::after {
  content: '';
  position: absolute;
  top: -30%;
  left: -75%;
  width: 52%;
  height: 160%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.38) 50%, transparent 100%);
  transform: skewX(-22deg);
  animation: tgfPillShimmer calc(3.2s / var(--ef-footer-spd, 1)) ease-in-out infinite;
}
.tgf-phone-pill:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--ef-hotline-bdr, #fde68a);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.36),
    0 0 calc(28px * var(--ef-glow, 1)) rgba(var(--ef-hotline-rgb, 234, 179, 8), 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.tgf-phone-pill__icon {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ef-hotline-lt, #fef08a) 0%, var(--ef-hotline, #eab308) 55%, var(--ef-hotline-dk, #ca8a04) 100%);
  color: #14221d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(var(--ef-hotline-rgb, 234, 179, 8), 0.5);
  animation: tgfPhonePulse calc(2s / var(--ef-footer-spd, 1)) ease-out infinite;
}
.tgf-phone-pill__icon svg {
  width: 17px;
  height: 17px;
  animation: tgfPhoneRing calc(3s / var(--ef-footer-spd, 1)) ease-in-out infinite;
}
.tgf-phone-pill__body {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  position: relative;
  z-index: 2;
}
.tgf-phone-pill__lbl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ef-hotline-lt, #fde68a);
  letter-spacing: 0.02em;
}
.tgf-live-dot {
  display: inline-block;
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--ef-hotline2, #34d399);
  box-shadow: 0 0 8px var(--ef-hotline2, #34d399);
  animation: tgfLiveBlink calc(1.6s / var(--ef-footer-spd, 1)) ease-in-out infinite;
}
.tgf-phone-pill__num {
  color: #ffffff;
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  margin-top: 2px;
}
.tgf-social {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tgf-social a,
.tgf-social__btn {
  position: relative;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}
.tgf-social a svg,
.tgf-social__btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.tgf-social a::after,
.tgf-social__btn::after {
  content: '';
  position: absolute;
  top: -35%;
  left: -95%;
  width: 65%;
  height: 170%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.48) 50%, transparent 100%);
  transform: skewX(-22deg);
  animation: tgfSocialSheen calc(3.6s / var(--ef-footer-spd, 1)) ease-in-out infinite;
  pointer-events: none;
}
.tgf-social a.tgf-social__btn--fb,
.tgf-social__btn--fb {
  background: linear-gradient(135deg, var(--ef-fb-lt, #3b9dff) 0%, var(--ef-fb, #1877f2) 55%, var(--ef-fb-dk, #0a52c6) 100%);
  border-color: var(--ef-fb-bdr, rgba(147, 197, 253, 0.85));
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(var(--ef-fb-rgb, 24, 119, 242), calc(0.55 * var(--ef-glow, 1))), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: tgfSocialPulseFb calc(2.4s / var(--ef-footer-spd, 1)) ease-in-out infinite;
}
.tgf-social a.tgf-social__btn--fb::after,
.tgf-social__btn--fb::after {
  animation-delay: calc(0.6s / var(--ef-footer-spd, 1));
}
.tgf-social a.tgf-social__btn--zalo,
.tgf-social__btn--zalo {
  min-width: 54px;
  padding: 0 12px;
  background: linear-gradient(135deg, var(--ef-zalo-lt, #1cb5ff) 0%, var(--ef-zalo, #0068ff) 58%, var(--ef-zalo-dk, #004ec4) 100%);
  border-color: var(--ef-zalo-bdr, rgba(125, 211, 252, 0.9));
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(var(--ef-zalo-rgb, 0, 104, 255), calc(0.58 * var(--ef-glow, 1))), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  letter-spacing: 0.02em;
  animation: tgfSocialPulseZalo calc(2.4s / var(--ef-footer-spd, 1)) ease-in-out infinite;
  animation-delay: calc(1s / var(--ef-footer-spd, 1));
}
.tgf-social a.tgf-social__btn--zalo::after,
.tgf-social__btn--zalo::after {
  animation-delay: calc(1.4s / var(--ef-footer-spd, 1));
}
.tgf-social a.tgf-social__btn--yt,
.tgf-social__btn--yt {
  background: linear-gradient(135deg, var(--ef-yt-lt, #ff4d4d) 0%, var(--ef-yt, #dc2626) 55%, var(--ef-yt-dk, #991b1b) 100%);
  border-color: rgba(252, 165, 165, 0.82);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.tgf-social a:hover,
.tgf-social__btn:hover {
  transform: translateY(-3px) scale(1.07);
  filter: brightness(1.1);
  color: #ffffff;
}

.tg-float-btn--zalo {
  background: var(--ef-float-zalo, #0068ff);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.tg-float-btn--phone {
  background: var(--ef-float-phone, #4caf50);
  animation: tgPulse calc(2s / var(--ef-footer-spd, 1)) infinite;
}

@keyframes tgfPillBreath {
  0%, 100% {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), 0 0 calc(14px * var(--ef-glow, 1)) rgba(var(--ef-hotline-rgb, 234, 179, 8), calc(0.28 * var(--ef-glow, 1))), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  }
  50% {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34), 0 0 calc(26px * var(--ef-glow, 1)) rgba(var(--ef-hotline-rgb, 250, 204, 21), calc(0.6 * var(--ef-glow, 1))), inset 0 1px 0 rgba(255, 255, 255, 0.38);
  }
}
@keyframes tgfPillShimmer {
  0%, 55% { left: -75%; opacity: 0; }
  64% { opacity: 1; }
  100% { left: 135%; opacity: 0; }
}
@keyframes tgfPhonePulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--ef-hotline-rgb, 250, 204, 21), calc(0.72 * var(--ef-glow, 1))), 0 3px 10px rgba(var(--ef-hotline-rgb, 234, 179, 8), 0.5); }
  70% { box-shadow: 0 0 0 calc(11px * var(--ef-glow, 1)) rgba(var(--ef-hotline-rgb, 250, 204, 21), 0), 0 3px 10px rgba(var(--ef-hotline-rgb, 234, 179, 8), 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(var(--ef-hotline-rgb, 250, 204, 21), 0), 0 3px 10px rgba(var(--ef-hotline-rgb, 234, 179, 8), 0.5); }
}
@keyframes tgfPhoneRing {
  0%, 70%, 100% { transform: rotate(0deg) scale(1); }
  74% { transform: rotate(-15deg) scale(1.08); }
  78% { transform: rotate(15deg) scale(1.08); }
  82% { transform: rotate(-12deg) scale(1.05); }
  86% { transform: rotate(10deg) scale(1.04); }
  90% { transform: rotate(0deg) scale(1); }
}
@keyframes tgfLiveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.78); }
}
@keyframes tgfSocialSheen {
  0%, 62% { left: -95%; opacity: 0; }
  72% { opacity: 1; }
  100% { left: 145%; opacity: 0; }
}
@keyframes tgfSocialPulseFb {
  0%, 100% { transform: translateY(0); box-shadow: 0 6px 16px rgba(var(--ef-fb-rgb, 24, 119, 242), calc(0.48 * var(--ef-glow, 1))), 0 0 0 0 rgba(var(--ef-fb-rgb, 59, 157, 255), calc(0.58 * var(--ef-glow, 1))), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
  50% { transform: translateY(-1.5px); box-shadow: 0 9px 22px rgba(var(--ef-fb-rgb, 24, 119, 242), calc(0.68 * var(--ef-glow, 1))), 0 0 0 calc(8px * var(--ef-glow, 1)) rgba(var(--ef-fb-rgb, 59, 157, 255), 0), inset 0 1px 0 rgba(255, 255, 255, 0.48); }
}
@keyframes tgfSocialPulseZalo {
  0%, 100% { transform: translateY(0); box-shadow: 0 6px 16px rgba(var(--ef-zalo-rgb, 0, 104, 255), calc(0.5 * var(--ef-glow, 1))), 0 0 0 0 rgba(var(--ef-zalo-rgb, 28, 181, 255), calc(0.62 * var(--ef-glow, 1))), inset 0 1px 0 rgba(255, 255, 255, 0.42); }
  50% { transform: translateY(-1.5px); box-shadow: 0 9px 22px rgba(var(--ef-zalo-rgb, 0, 104, 255), calc(0.72 * var(--ef-glow, 1))), 0 0 0 calc(8px * var(--ef-glow, 1)) rgba(var(--ef-zalo-rgb, 28, 181, 255), 0), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
}
@keyframes tgDockTopBeam {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes tgDockZaloPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 4px 12px rgba(var(--ef-dock-zalo-rgb, 0, 104, 255), calc(0.42 * var(--ef-glow, 1))), 0 0 0 0 rgba(var(--ef-dock-zalo-rgb, 0, 132, 255), calc(0.55 * var(--ef-glow, 1))); }
  55% { transform: translateY(-1.5px); box-shadow: 0 6px 16px rgba(var(--ef-dock-zalo-rgb, 0, 104, 255), calc(0.58 * var(--ef-glow, 1))), 0 0 0 calc(7px * var(--ef-glow, 1)) rgba(var(--ef-dock-zalo-rgb, 0, 132, 255), 0); }
}
@keyframes tgDockCallPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 4px 12px rgba(var(--ef-dock-call-rgb, 22, 163, 74), calc(0.44 * var(--ef-glow, 1))), 0 0 0 0 rgba(var(--ef-dock-call-rgb, 34, 197, 94), calc(0.6 * var(--ef-glow, 1))); }
  55% { transform: translateY(-1.5px); box-shadow: 0 6px 16px rgba(var(--ef-dock-call-rgb, 22, 163, 74), calc(0.6 * var(--ef-glow, 1))), 0 0 0 calc(7px * var(--ef-glow, 1)) rgba(var(--ef-dock-call-rgb, 34, 197, 94), 0); }
}
@keyframes tgPulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--ef-float-phone-rgb, 76, 175, 80), calc(0.65 * var(--ef-glow, 1))); }
  70% { box-shadow: 0 0 0 calc(15px * var(--ef-glow, 1)) rgba(var(--ef-float-phone-rgb, 76, 175, 80), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--ef-float-phone-rgb, 76, 175, 80), 0); }
}

@media (prefers-reduced-motion: reduce) {
  [class*="hcm-anim-"],
  .tg-ticker__track,
  .tgf-phone-pill,
  .tgf-phone-pill::before,
  .tgf-phone-pill__shine::after,
  .tgf-phone-pill__icon,
  .tgf-phone-pill__icon svg,
  .tgf-live-dot,
  .tgf-social a,
  .tgf-social__btn,
  .tgf-social a::after,
  .tgf-social__btn::after,
  .tg-float-btn--phone,
  .tg-mobile-dock::before,
  .tg-mdock-zalo-dot,
  .tg-mdock-zalo-dot::after,
  .tg-mdock-call-dot,
  .tg-mdock-call-dot svg {
    animation: none !important;
  }
}
