/* ============================================================
   VI FEERIE — Banner Free Ship góc dưới trái
   - Slide vào từ mép trái sau khi load
   - Icon xe tải rung nhẹ định kỳ
   - Đóng được, nhớ 24h qua localStorage
   ============================================================ */

.freeship[hidden] {
  display: none !important;
}

.freeship {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-deeper));
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(56, 34, 19, 0.28);
  transform: translateX(-140%);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.4s var(--ease);
}

.freeship.is-open {
  transform: translateX(0);
  opacity: 1;
}

/* Khi user scroll gần footer thì trượt xuống ẩn đi để không đè liên hệ */
.freeship.is-tucked {
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
}

.freeship__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  animation: freeship-truck 2.4s ease-in-out infinite;
}

.freeship__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.freeship__text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.2;
  font-size: 13px;
  padding-right: 4px;
}

.freeship__text b {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.freeship__text em {
  font-style: normal;
  font-size: 11.5px;
  opacity: 0.85;
  margin-top: 2px;
}

.freeship__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.freeship__close svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.freeship__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Xe rung nhẹ như đang chạy: ping-pong, kèm khựng chân 1 nhịp */
@keyframes freeship-truck {
  0%, 100% { transform: translateX(-2px); }
  35%      { transform: translateX(2px); }
  55%      { transform: translateX(-1px) rotate(-2deg); }
  70%      { transform: translateX(1px) rotate(2deg); }
  85%      { transform: translateX(0); }
}

/* Nhấn lấp lánh 4s/lần trên toàn viên pill */
@keyframes freeship-glow {
  0%, 100% { box-shadow: 0 12px 28px rgba(56, 34, 19, 0.28); }
  50%      { box-shadow: 0 12px 28px rgba(56, 34, 19, 0.28),
                        0 0 0 4px rgba(255, 255, 255, 0.15); }
}

.freeship.is-open {
  animation: freeship-glow 4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .freeship,
  .freeship__icon { animation: none !important; }
  .freeship { transition: opacity 0.2s ease; transform: none; }
  .freeship.is-tucked { display: none; }
}

/* ---------------- Responsive ---------------- */
@media screen and (max-width: 640px) {
  .freeship {
    left: 12px;
    bottom: 12px;
    gap: 8px;
    padding: 8px 12px 8px 8px;
  }

  .freeship__icon {
    width: 30px;
    height: 30px;
  }

  .freeship__icon svg {
    width: 17px;
    height: 17px;
  }

  .freeship__text {
    font-size: 12px;
  }

  .freeship__text em {
    font-size: 10.5px;
  }
}
