/* public/css/components/christmas.css */
/* 聖誕活動特效：navbar 聖誕帽、下雪 canvas、右下角聖誕樹。
   只在活動期間由 layout.php 載入。層級：header 1000、頂部購買列 999，
   特效在其下，不蓋住 Cookie 橫幅（9999）與購物車抽屜（10000）。 */

/* ==================== navbar 聖誕帽 ==================== */
/* 文字包一層 inline-block，帽子對齊文字右上角 */
.xmas-link-text {
  position: relative;
  display: inline-block;
}

.xmas-hat {
  position: absolute;
  top: -17px;
  right: -14px;
  width: 26px;
  height: 23px;
  pointer-events: none;
  transform: rotate(20deg);
  transform-origin: 20% 90%;
  animation: xmas-hat-swing 2.8s ease-in-out infinite;
}

@keyframes xmas-hat-swing {
  0%,
  100% {
    transform: rotate(20deg);
  }
  50% {
    transform: rotate(28deg);
  }
}

/* ==================== 下雪 ==================== */
.xmas-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 990;
  pointer-events: none;
}

/* ==================== 右下角聖誕樹 ==================== */
/* 動畫由 Lottie 自己播放（js/base/christmas-tree.js），這裡只管位置與大小 */
.xmas-tree {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 128px;
  height: 128px;
  z-index: 991;
  display: block;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.2));
}

.xmas-tree__lottie {
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .xmas-tree {
    right: 8px;
    bottom: 8px;
    width: 96px;
    height: 96px;
  }

  /* 商品頁手機版底部有固定的加入購物車按鈕，樹不顯示 */
  body:has(.cartFormWrapper) .xmas-tree {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xmas-hat {
    animation: none;
  }
}
