/* =======================================================
   LUXE PRODUCT CARD (thẻ sản phẩm)
======================================================== */
.luxe-card-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: 'Mulish', sans-serif;
  justify-content: flex-start !important;
}

/* ----- Khung ảnh ----- */
.luxe-img-container {
  position: relative;
  width: 100%;
  aspect-ratio: 2.7/4.05;
  overflow: hidden;
  background: #F6F1E6;
  border-radius: 7px;
}
.luxe-img-link {
  display: block;
  width: 100%;
  height: 100%;
}
.luxe-img-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}
.luxe-card-wrapper:hover .luxe-img-link img {
  transform: scale(1.05);
}

/* ----- Nút trái tim ----- */
.sobie-wishlist-btn {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 15;
  background: transparent !important;
  border: none;
  padding: 0;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: none !important;
  color: #000 !important;
}
.sobie-wishlist-btn:hover { transform: scale(1.15); }

/* ----- Tag (NEW, SALE, HOT, Sold out) ----- */
.luxe-tags {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tag {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fff;
  color: #16283A;
  border: 1px solid #16283A;
  display: inline-block;
  line-height: 1;
}
/* Brand V2.0 — phân vai tag: SALE = Vàng SOBIE (sự chú ý), Sold out = bạc, NEW/HOT = viền navy */
.tag-new, .tag-hot {
  background: #fff;
  color: #16283A;
}
.tag-sale {
  background: #FFF000 !important;
  color: #16283A !important;
  border-color: #FFF000 !important;
}
.tag-sold-out {
  background: #CECECE !important;
  color: #16283A !important;
  border-color: #CECECE !important;
}

/* ----- Tag chất liệu vải (góc dưới phải ảnh) ----- */
.luxe-mat-tag {
  position: absolute;
  bottom: 10px; right: 10px;
  z-index: 9;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #16283A;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(22,40,58,0.18);
  padding: 3px 7px;
  border-radius: 6px;
  line-height: 1;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ----- Quick Add hover ----- */
.cool-quick-add {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  padding: 12px 10px;
  box-sizing: border-box;
  border-top: 1px solid rgba(0,0,0,0.05);
  z-index: 10;
}
.luxe-img-container:hover .cool-quick-add { transform: translateY(0); }
.cool-quick-add.is-visible { transform: translateY(0) !important; }

.cool-quick-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  color: #16283A;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.cool-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.cool-var-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #16283A;
  cursor: pointer;
  min-width: 40px;
  transition: 0.2s;
}
.cool-var-btn:hover {
  background: #0A7FD9;
  color: #fff;
  border-color: #0A7FD9;
}
.cool-var-btn.disabled {
  background: #f5f5f5;
  color: #ccc;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* ----- Khu vực thông tin ----- */
.luxe-info-container {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 0 !important;
  text-align: left;
  justify-content: flex-start !important;
}
.luxe-info-container > div:last-child {
  margin-top: 8px !important;
}

.luxe-vendor {
  font-size: 10px;
  color: #5A6B7B;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 4px;
  letter-spacing: 0.5px;
}

.luxe-product-title {
  font-size: 13px;
  font-weight: 600;
  color: #16283A;
  margin: 0 0 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: calc(1.4em * 2);
}
.luxe-product-title a { color: inherit; text-decoration: none; }
.luxe-product-title a:hover { text-decoration: underline; }

.luxe-info-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
}

.price-box {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
}
.old-price {
  font-size: 11px;
  color: #5A6B7B;
  text-decoration: line-through;
}

.luxe-add-cart {
  background: #fff;
  border: 1px solid #0A7FD9;
  border-radius: 8px !important;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0A7FD9;
  cursor: pointer;
  transition: 0.3s;
  padding: 0;
  flex-shrink: 0;
}
.luxe-add-cart:hover { background: #0A7FD9; color: #fff; }

/* ----- Mobile ----- */
@media (max-width: 767px) {
  .cool-quick-add { transform: translateY(100%); padding: 8px 5px; }
  .cool-quick-title {
    font-size: 9px;
    margin-bottom: 6px;
    white-space: nowrap;
  }
  .sobie-wishlist-btn {
    width: 24px;
    height: 24px;
    top: 8px;
    right: 8px;
  }
  .sobie-wishlist-btn svg {
    width: 18px;
    height: 18px;
  }
  .cool-variants { gap: 4px; }
  .cool-var-btn {
    padding: 5px 6px;
    font-size: 10px;
    min-width: 32px;
  }
  .luxe-mat-tag { bottom: 8px; right: 8px; padding: 3px 6px; font-size: 7.5px; }
}
/* =======================================================
   NHÃN KHUYẾN MÃI TRÊN THẺ  (snippet km-flags / assets/km-flags.js)
   • .km-strip  — dải ngang đáy ảnh: Freeship · Voucher Xtra …
   • .km-badge  — nút tròn ngay dưới trái tim, dành cho quà tặng
======================================================== */
.km-strip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 8;                      /* dưới .cool-quick-add (z-index 10) */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 32px;
  padding: 6px 8px;
  box-sizing: border-box;
  background: #16283A;
  color: #fff;
  font-family: 'Mulish', sans-serif;
  transition: transform .3s cubic-bezier(.165,.84,.44,1), opacity .2s ease;
}
.km-seg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.km-seg b { font-weight: 700; letter-spacing: .01em; }
.km-seg svg { width: 14px; height: 14px; flex: none; }
/* Vạch ngăn giữa các đoạn */
.km-seg + .km-seg::before {
  content: "";
  width: 1px; height: 13px;
  margin-right: 10px;
  background: rgba(255,255,255,.35);
}
/* Rê chuột: lớp "Thêm nhanh vào giỏ" trồi lên, dải trượt xuống nhường chỗ */
.luxe-img-container:hover .km-strip { transform: translateY(100%); opacity: 0; }
/* Nhãn chất liệu (SOWAVE) nhích lên nằm trên dải */
.luxe-img-container:has(.km-strip) .luxe-mat-tag,
.km-strip ~ .luxe-mat-tag { bottom: 42px; }

/* Nút tròn quà tặng, ngay dưới trái tim */
.km-badge {
  position: absolute;
  top: 46px; right: 12px;
  z-index: 15;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  color: #16283A;
}
.km-badge svg { width: 22px; height: 22px; }

/* Dải dùng lại ở trang chi tiết sản phẩm (nằm trong dòng, không đè ảnh) */
.km-inline .km-strip {
  position: static;
  border-radius: 8px;
  justify-content: flex-start;
  min-height: 38px;
  padding: 8px 14px;
}
.km-inline .km-seg { font-size: 12.5px; }
.km-inline .km-seg svg { width: 16px; height: 16px; }
/* Khoảng cách trên dưới bằng nhau với các khối quanh nó */
.sb-pdp .km-inline { margin: 14px 0 14px; }
@media (max-width: 992px) { .sb-pdp .km-inline { margin: 0 0 16px !important; } }

@media (max-width: 767px) {
  .km-strip { min-height: 28px; gap: 7px; padding: 5px 6px; }
  .km-seg { font-size: 9.5px; gap: 4px; }
  .km-seg svg { width: 12px; height: 12px; }
  .km-seg + .km-seg::before { margin-right: 7px; height: 11px; }
  /* Thẻ 2 cột quá hẹp: chỉ giữ 2 đoạn đầu */
  .km-strip .km-seg:nth-of-type(n+3) { display: none; }
  .km-badge { top: 38px; right: 8px; width: 24px; height: 24px; }
  .km-badge svg { width: 19px; height: 19px; }
  .luxe-img-container:has(.km-strip) .luxe-mat-tag,
  .km-strip ~ .luxe-mat-tag { bottom: 36px; }
}

/* ===== Popup xem trước danh sách quà (bấm nút quà trên thẻ / trang chi tiết) ===== */
.km-badge { border: 0; padding: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.kmp-ov { position: fixed; inset: 0; z-index: 4200; background: rgba(22,40,58,.5); display: flex; align-items: center; justify-content: center; padding: 16px; font-family: 'Mulish', system-ui, sans-serif; }
.kmp-md { width: 100%; max-width: 440px; max-height: 84vh; display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px -12px rgba(22,40,58,.45); }
.kmp-hd { position: relative; padding: 15px 50px; border-bottom: 1px solid #EEF1F4; text-align: center; }
.kmp-hd b { display: block; font-size: 15px; font-weight: 800; color: #16283A; }
.kmp-hd span { display: block; margin-top: 2px; font-size: 11.5px; color: #5A6B7B; }
.kmp-x { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: #F3F5F7; font-size: 19px; line-height: 1; color: #16283A; cursor: pointer; }
.kmp-ls { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.kmp-it { display: flex; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid #F1F4F7; }
.kmp-it img, .kmp-ph { flex: none; width: 56px; height: 56px; border-radius: 8px; border: 1px solid #EEF1F4; object-fit: contain; background: #fff; }
.kmp-bd { flex: 1; min-width: 0; }
.kmp-t { font-size: 13px; font-weight: 700; color: #16283A; line-height: 1.35; }
.kmp-p { display: flex; align-items: baseline; gap: 8px; margin-top: 5px; }
.kmp-p s { font-size: 11.5px; color: #9AA8B5; }
.kmp-p strong { font-size: 14px; font-weight: 800; color: #E0245E; }
.kmp-p em { font-style: normal; font-size: 10.5px; font-weight: 800; color: #16283A; background: #FFF000; border-radius: 4px; padding: 2px 5px; }
.kmp-msg { padding: 26px 16px; text-align: center; font-size: 13px; color: #5A6B7B; }
.kmp-ft { padding: 12px 16px; border-top: 1px solid #EEF1F4; }
.kmp-cta { width: 100%; padding: 13px; border: 0; border-radius: 8px; background: #16283A; color: #fff; font: 800 13px 'Mulish', sans-serif; cursor: pointer; }
@media (max-width: 600px) { .kmp-ov { align-items: flex-end; padding: 0; } .kmp-md { max-width: none; max-height: 86vh; border-radius: 14px 14px 0 0; } }

/* Khi popup chọn/xem quà mở: ẩn thanh dưới, nút liên hệ và widget chat để không che nút bấm */
body.sb-modal-open .mobile-bottom-nav,
body.sb-modal-open .sobie-sticky-wrap,
body.sb-modal-open [data-sobie-moved],
body.sb-modal-open #fb-root,
body.sb-modal-open .fb_dialog,
body.sb-modal-open .fb-customerchat,
body.sb-modal-open #back-to-top { visibility: hidden !important; pointer-events: none !important; }