/* cashback.css — nút Hoàn tiền HoanVi + toast copy link + search popup kết quả trực tiếp.
   Quy ước hệ thống: nút mua = màu brand, nút hoàn tiền = VÀNG ĐỒNG (nhận diện chung mọi trang). */

:root { --cash-ease: cubic-bezier(.22,.61,.36,1); }

/* ============ NÚT HOÀN TIỀN (base) ============ */
.cta-cashback {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(120deg, #E9C97E, var(--gold, #C9A961) 45%, #A8863B);
  background-size: 180% 100%;
  color: #4F3A10; font-weight: 600; text-decoration: none;
  border-radius: 999px; white-space: nowrap;
  transition: background-position .4s var(--cash-ease), transform .25s var(--cash-ease), box-shadow .3s var(--cash-ease);
}
.cta-cashback:hover {
  background-position: 90% 0; transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201,169,97,.35);
}
.cta-cashback .cash-coin { display: inline-block; }
.cta-cashback:hover .cash-coin { animation: coinFlip .6s var(--cash-ease); }
@keyframes coinFlip { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }

/* Bản to — trang sản phẩm, đặt dưới nút mua chính */
.pd-cta-cashback {
  width: 100%; padding: 13px 22px; margin-top: 10px;
  font-size: 15px; box-sizing: border-box;
}
.pd-cta-cashback .pd-cash-note {
  font-size: 11px; font-weight: 500; opacity: .8;
}

/* Bản nhỏ — cta-box trong bài viết, bảng so sánh */
.cash-sm { font-size: 12.5px; padding: 9px 16px; }

/* Bản sticky bar đáy trang sản phẩm */
.pd-sticky-cash { font-size: 13px; padding: 10px 16px; flex-shrink: 0; }

/* ============ TOAST COPY LINK ============ */
#copy-toast {
  position: fixed; left: 50%; bottom: 86px;
  transform: translate(-50%, 16px);
  background: var(--mint-900, #1F4A3F); color: var(--ivory, #FBF8F3);
  font-size: 13.5px; padding: 11px 18px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  max-width: min(92vw, 480px); text-align: center; line-height: 1.45;
}
#copy-toast.show { opacity: 1; transform: translate(-50%, 0); }
#copy-toast b { color: #F3D9A0; }

/* ============ SEARCH POPUP ============ */
form[data-live-search] { position: relative; }
.search-popup {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0;
  background: var(--ivory, #fff); border: 1px solid var(--mint-200, #DCE9E2);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.18);
  z-index: 70; text-align: left; overflow: hidden;
  animation: spPopIn .28s ease; transform-origin: top center;
}
@keyframes spPopIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; } }
.sp-head {
  display: flex; justify-content: space-between; gap: 10px; padding: 10px 16px;
  font-size: 12px; color: var(--ink-500, #6E7A73);
  background: var(--cream, #F5EFE6); border-bottom: 1px solid var(--mint-200, #DCE9E2);
}
.sp-list { max-height: 388px; overflow-y: auto; }
.sp-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--mint-100, #EAF2ED);
  animation: spItemIn .35s ease both; transition: background .25s;
}
.sp-item:hover { background: var(--mint-50, #F2F7F4); }
@keyframes spItemIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; } }
.sp-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.sp-thumb {
  width: 52px; height: 52px; border-radius: 10px; object-fit: cover;
  flex-shrink: 0; background: var(--cream, #F5EFE6); transition: transform .35s;
}
.sp-item:hover .sp-thumb { transform: scale(1.08); }
.sp-info { flex: 1; min-width: 0; }
.sp-name {
  font-size: 12.5px; font-weight: 500; color: var(--ink-900, #1A1F1C);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-meta { display: flex; gap: 8px; font-size: 11px; color: var(--ink-500, #6E7A73); }
.sp-meta .sp-stars { color: var(--gold, #C9A961); letter-spacing: 1px; }
.sp-price { display: flex; align-items: baseline; gap: 6px; margin-top: 3px; }
.sp-price .sp-price-new { font-size: 14.5px; font-weight: 700; color: var(--mint-900, #1F4A3F); }
.sp-price-old { color: var(--ink-500, #6E7A73); text-decoration: line-through; font-size: 11px; }
.sp-off-chip {
  background: rgba(220,96,96,.12); color: #C25454; font-size: 10px;
  padding: 0 6px; border-radius: 999px; font-weight: 600;
}
.sp-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.sp-buy, .sp-cash {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px;
  white-space: nowrap; text-decoration: none;
  transition: transform .22s var(--cash-ease), box-shadow .25s var(--cash-ease), background-position .4s var(--cash-ease);
}
.sp-buy {
  background: linear-gradient(120deg, var(--mint-700, #2F5F4E), var(--mint-900, #1F4A3F));
  background-size: 180% 100%; color: #fff;
}
.sp-buy:hover, .sp-cash:hover { background-position: 90% 0; transform: translateY(-1px); }
.sp-empty { padding: 22px 16px; font-size: 13px; color: var(--ink-500, #6E7A73); text-align: center; }
.sp-all {
  width: 100%; padding: 11px; background: var(--cream, #F5EFE6); color: var(--mint-900, #1F4A3F);
  font-size: 12.5px; font-weight: 600; border: none; border-top: 1px solid var(--mint-200, #DCE9E2);
  cursor: pointer; font-family: inherit;
}
@media (max-width: 560px) {
  .sp-item { flex-wrap: wrap; }
  .sp-actions { flex-direction: row; width: 100%; }
  .sp-buy, .sp-cash { flex: 1; }
}

/* ============ GIẢM CHUYỂN ĐỘNG ============ */
@media (prefers-reduced-motion: reduce) {
  .cta-cashback, .cta-cashback:hover .cash-coin, .search-popup, .sp-item { animation: none; }
  .cta-cashback, .sp-buy, .sp-cash, .sp-thumb, #copy-toast { transition: none; }
}
