/* Bút Đàm · lớp chuyển động dùng chung (gian hàng + trang giới thiệu).
 * Mọi hiệu ứng tắt khi người dùng bật "giảm chuyển động". Đi cùng js/chuyen-dong.js. */
:root { --cd-em: cubic-bezier(.2, .7, .1, 1); --cd-son: #B4432D; }

/* thanh tiến độ đọc trang */
.cd-tien { position: fixed; left: 0; top: 0; z-index: 90; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #B78A3E, var(--cd-son)); pointer-events: none; }

/* ảnh lộ dần (rèm kéo lên + thu nhỏ) */
.cd-on [data-cd-anh] { clip-path: inset(0 0 100% 0 round 4px); transition: clip-path 1.2s var(--cd-em); }
.cd-on [data-cd-anh] img { transform: scale(1.12); transition: transform 1.6s var(--cd-em); }
.cd-on [data-cd-anh].cd-vao { clip-path: inset(0 0 0 0 round 4px); }
.cd-on [data-cd-anh].cd-vao img { transform: none; }

/* tiêu đề hiện từng chữ */
.cd-tu { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.cd-tu > i { display: inline-block; font-style: inherit; transform: translateY(105%); transition: transform .9s var(--cd-em); transition-delay: calc(var(--k, 0) * 45ms); }
.cd-vao .cd-tu > i { transform: none; }

/* nút chính: vệt sáng quét qua định kỳ + nảy nhẹ khi rê */
.cd-loe { position: relative; overflow: hidden; isolation: isolate; }
.cd-loe::after { content: ""; position: absolute; inset: -20% auto -20% -40%; width: 32%; transform: skewX(-20deg) translateX(-120%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent); animation: cdLoe 4.8s var(--cd-em) infinite; pointer-events: none; z-index: 1; }
.cd-loe > * { position: relative; z-index: 2; }
@keyframes cdLoe { 0%, 62% { transform: skewX(-20deg) translateX(-120%); } 82%, 100% { transform: skewX(-20deg) translateX(520%); } }
.cd-loe:active { transform: scale(.98); }

/* vòng gợn quanh nút ở thanh dưới */
.cd-gon { position: relative; }
.cd-gon::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(180, 67, 45, .45); animation: cdGon 2.6s ease-out infinite; pointer-events: none; }
@keyframes cdGon { 0% { box-shadow: 0 0 0 0 rgba(22, 58, 54, .45); } 70%, 100% { box-shadow: 0 0 0 12px rgba(22, 58, 54, 0); } }

/* số tiền đổi: nảy */
.cd-nay { animation: cdNay .5s var(--cd-em); }
@keyframes cdNay { 0% { transform: translateY(6px); opacity: .2; } 60% { transform: translateY(-2px); opacity: 1; } 100% { transform: none; } }

/* thẻ nổi khi rê */
.cd-noi { transition: transform .45s var(--cd-em), box-shadow .45s var(--cd-em); }
@media (hover: hover) { .cd-noi:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -26px rgba(15, 41, 38, .55); } }

/* nghiêng theo chuột (ảnh lớn) */
[data-cd-nghieng] { transition: transform .6s var(--cd-em); transform-style: preserve-3d; will-change: transform; }

/* tham chiếu cuộn (trang trí trôi chậm) */
[data-cd-tham] { will-change: transform; }

/* đổi màn điện thoại */
.cd-man { transition: opacity .7s ease; }
.cd-man.cd-mo { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .cd-tien { display: none; }
  .cd-on [data-cd-anh], .cd-on [data-cd-anh] img { clip-path: none !important; transform: none !important; transition: none !important; }
  .cd-tu > i { transform: none !important; transition: none !important; }
  .cd-loe::after, .cd-gon::before { animation: none !important; display: none; }
  .cd-nay { animation: none; }
  [data-cd-nghieng], [data-cd-tham] { transform: none !important; }
}
