#productGrid .kp-sale-clock{position:absolute;z-index:3;top:58px;left:12px;display:inline-block;max-width:calc(100% - 24px);box-sizing:border-box;padding:4px 7px;border:1px solid #fed7aa;border-radius:7px;background:#fff7edee;color:#9a3412;font-size:11px;line-height:1.3;font-weight:800;white-space:nowrap;pointer-events:none;font-variant-numeric:tabular-nums;box-shadow:0 2px 6px #0f172a0a}@media(max-width:640px){#productGrid .kp-sale-clock{left:6px;top:44px;font-size:9px;padding:3px 5px;max-width:calc(100% - 12px)}}
#productGrid .kp-sale-clock{top:auto!important;bottom:8px!important;left:50%!important;transform:translateX(-50%);padding:5px 9px!important;max-width:calc(100% - 16px)!important;font-size:11px!important;line-height:1.3!important;text-align:center;background:#fff7edfa!important;border:1px solid #fdba74!important;color:#9a3412!important;border-radius:7px!important}#productGrid .kpos-card-coupon{display:none!important}@media(max-width:640px){#productGrid .kp-sale-clock{bottom:5px!important;padding:4px 6px!important;font-size:9px!important}}

#productGrid .kp-sale-clock{position:absolute!important;left:0!important;right:0!important;bottom:0!important;top:auto!important;transform:none!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;padding:9px 5px!important;border:0!important;border-top:1px solid #ffb09b!important;border-radius:0 0 14px 14px!important;background:linear-gradient(110deg,#ef003c,#ff3d24 65%,#ff6615)!important;color:#fff!important;font-size:16px!important;font-weight:900!important;line-height:1.3!important;text-align:center!important;letter-spacing:.015em;box-shadow:0 -3px 14px #e6004620!important;text-shadow:0 1px 2px #9f123940}
#productGrid .kp-flash-active .kpos-sale-badge{display:none!important}


@media(max-width:640px){#productGrid .kp-sale-clock{padding:7px 3px!important;font-size:12px!important;border-radius:0 0 10px 10px!important;letter-spacing:0}}


/* Giữ mọi phần của thẻ trong cột; chỉ logo được nhô nhẹ ở góc. */
@media (max-width: 768px) {
  #products #productGrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #products #productGrid > .product { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; }
  #products #productGrid .product-card-image-box { display: flex; box-sizing: border-box !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; align-self: stretch !important; }
  #products #productGrid .product-card-image-box > img { display: block; flex: 0 1 auto; min-width: 0 !important; width: 100% !important; height: 100% !important; max-width: 100% !important; max-height: 100% !important; object-fit: contain !important; }
  #products #productGrid .product-card-body, #products #productGrid .product-card-price-row { min-width: 0 !important; max-width: 100% !important; }
  #products #productGrid .product h3 { overflow-wrap: anywhere; }

  #products #productGrid .kp-sale-clock { box-sizing: border-box !important; left: 0 !important; right: 0 !important; width: auto !important; min-width: 0 !important; max-width: 100% !important; padding: 6px 2px !important; font-size: clamp(9px, 2.7vw, 12px) !important; white-space: nowrap !important; overflow: hidden; }
  #products #productGrid .product-card-tools { right: 5px !important; }
}
#productGrid > .kp-flash-active {
  position: relative;
  overflow: visible !important;
}

#productGrid > .kp-flash-active .kp-flash-sale-logo {
  position: absolute;
  z-index: 6;
  top: -7px;
  left: -8px;
  width: clamp(76px, 10vw, 110px);
  aspect-ratio: 150 / 92;
  filter: drop-shadow(0 3px 4px #9f123950);
  transform: rotate(-13deg);
  transform-origin: left center;
  pointer-events: none;
}

#productGrid .kp-flash-sale-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 640px) {
  #productGrid > .kp-flash-active .kp-flash-sale-logo {
    top: -5px;
    left: -4px;
    width: clamp(66px, 19vw, 84px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  #productGrid .kp-flash-sale-logo {
    animation: kpos-flash-ribbon 4.8s ease-in-out infinite;
  }
}

@keyframes kpos-flash-ribbon {
  0%, 100% { transform: rotate(-13deg); }
  10% { transform: translate(4px, -3px) rotate(-8deg) scale(1.04); }
  20% { transform: translate(-1px, 0) rotate(-15deg); }
  30%, 90% { transform: rotate(-13deg); }
}
