/* ================================================================
   FACCO Upgrades v2 — 2026-05-14
   Wishlist (localStorage) + Print Catalogue PDF + GA4 events
   ================================================================ */

/* ── WISHLIST HEART BUTTON trên product card ────────────────── */
.prod-card-wrap {
  position: relative;
}

.prod-card__wish {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  z-index: 3;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.15s, color 0.2s;
  color: #999;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.prod-card__wish:hover {
  background: #fff;
  transform: scale(1.18);
  color: #D40020;
}

.prod-card__wish.is-wished {
  color: #D40020;
  background: #fff;
}

/* Đảm bảo img-wrap có position relative để nút được đặt đúng vị trí */
.prod-card__img-wrap {
  position: relative !important;
}

/* ── WISHLIST BADGE trên header ─────────────────────────────── */
.wl-util-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.wl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: #D40020;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  line-height: 1;
  transition: transform 0.2s;
}

.wl-badge:empty {
  display: none;
}

/* ── TRANG WISHLIST ─────────────────────────────────────────── */
.wl-print-header {
  display: none;
}

.wishlist-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.wishlist-actions-count {
  font-size: 13px;
  color: #888;
  margin-left: auto;
}

/* Nút xuất PDF */
.btn--wl-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #D40020;
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s;
  font-family: inherit;
}

.btn--wl-export:hover {
  background: #b00018;
  transform: translateY(-1px);
}

/* Nút xóa tất cả */
.btn--wl-clear {
  background: transparent;
  color: #888;
  border: 1px solid #ddd;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  font-family: inherit;
}

.btn--wl-clear:hover {
  border-color: #D40020;
  color: #D40020;
}

/* Empty state */
.wl-empty {
  text-align: center;
  padding: 80px 20px;
  color: #aaa;
}

.wl-empty__icon {
  font-size: 56px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.4;
}

.wl-empty h2 {
  font-size: 20px;
  font-weight: 600;
  color: #555;
  margin: 0 0 10px;
}

.wl-empty p {
  font-size: 14px;
  margin: 0 0 24px;
}

.wl-empty a {
  display: inline-block;
  background: #D40020;
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.wl-empty a:hover {
  background: #b00018;
}

/* Nút remove trên card trong trang wishlist */
.prod-card__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  color: #D40020;
  transition: background 0.18s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.prod-card__remove:hover {
  background: #D40020;
  color: #fff;
}

/* ── IN ẤN — Catalogue PDF qua trình duyệt ─────────────────── */
@media print {
  /* Ẩn mọi UI ngoại trừ grid sản phẩm */
  .site-header,
  .site-footer,
  .hotline-float,
  .zalo-float,
  #sakura-canvas,
  .bg-grid,
  .page-corner,
  .wishlist-actions,
  .toast,
  .page-hero {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #1a1a1a;
  }

  /* Tiêu đề catalogue chỉ hiện khi in */
  .wl-print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0 16px;
    border-bottom: 2.5px solid #D40020;
    margin-bottom: 20px;
    page-break-after: avoid;
  }

  .wl-print-header img {
    height: 36px;
    width: auto;
  }

  .wl-print-header__title {
    font-size: 16px;
    font-weight: 700;
    color: #D40020;
    margin: 0;
  }

  .wl-print-header__sub {
    font-size: 10px;
    color: #888;
    margin: 2px 0 0;
  }

  .wl-print-header__contact {
    text-align: right;
    font-size: 10px;
    color: #555;
    line-height: 1.6;
  }

  /* Grid 3 cột trên A4 */
  .products-grid,
  #wl-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
  }

  .prod-card-wrap,
  .prod-card {
    break-inside: avoid;
  }

  .prod-card {
    border: 1px solid #e8e8e8 !important;
    border-radius: 4px !important;
    overflow: hidden;
  }

  .prod-card__img {
    width: 100% !important;
    height: 140px !important;
    object-fit: cover !important;
    display: block !important;
  }

  .prod-card__info {
    padding: 6px 8px 8px !important;
  }

  .prod-card__name {
    font-size: 10px !important;
    font-weight: 700 !important;
    margin: 0 0 2px !important;
  }

  .prod-card__collection {
    font-size: 9px !important;
    color: #888 !important;
    margin: 0 !important;
  }

  .prod-card__wish,
  .prod-card__remove,
  .prod-card__swatches,
  .wl-empty {
    display: none !important;
  }

  @page {
    size: A4;
    margin: 1.5cm;
  }
}
