/* === NN Promotions === */

/* ---------- Fee labels with small description (cart/checkout + Xootix) ---------- */
.nn-fee-label {
  display: block;
  font-weight: 600;
  line-height: 1.25;
}
.nn-fee-desc {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  color: #666;
  opacity: 0.85;
  letter-spacing: 0;
  text-transform: none;
}
.xoo-wsc-ft-amt-label .nn-fee-label,
.xoo-wsc-ft-amt-label .nn-fee-desc {
  display: block;
}
.xoo-wsc-ft-amt {
  align-items: flex-start;
}


/* ---------- Badges ---------- */
.nn-promo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
  pointer-events: none;
}
.nn-promo-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 4px;
  line-height: 1.2;
}
.nn-promo-badge--3x2 {
  background: linear-gradient(135deg, #ff5e5e, #ff2e2e);
  color: #fff;
}
.nn-promo-badge--gift {
  background: linear-gradient(135deg, #ffb74d, #ff7043);
  color: #fff;
}
.nn-promo-badges--loop {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}
.nn-promo-badges--single {
  margin: 0 0 12px 0;
}
/* Ensure loop products have relative positioning for absolute badges */
.products .product-wrap,
.products .product {
  position: relative;
}

/* ---------- Gift labels in cart ---------- */
.nn-gift-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ffb74d, #ff7043);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 3px;
  margin-right: 6px;
  text-transform: uppercase;
  vertical-align: middle;
}
.nn-gift-meta {
  margin-top: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nn-gift-price del { opacity: 0.6; margin-right: 4px; }
.nn-gift-price strong { color: #2e7d32; font-weight: 700; }
.nn-gift-qty { font-weight: 600; padding: 0 10px; }

.nn-change-gift,
.nn-choose-gift-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1e6bd6;
  background: rgba(30, 107, 214, 0.08);
  border: 1px solid rgba(30, 107, 214, 0.3);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nn-change-gift:hover,
.nn-choose-gift-btn:hover {
  background: #1e6bd6;
  color: #fff;
  text-decoration: none;
}
.nn-xootix-gift-row,
.nn-xootix-offer-row,
.nn-cart-offer-row {
  margin-top: 6px;
  font-size: 12px;
}

/* ---------- Popup ---------- */
/* z-index must exceed Xootix side cart (9999997) */
.nn-gift-popup {
  position: fixed;
  inset: 0;
  z-index: 99999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.nn-gift-popup__backdrop {
  z-index: 1;
}
.nn-gift-popup__dialog {
  z-index: 2;
}
.nn-gift-popup.is-open {
  display: flex;
  animation: nn-fade-in 0.2s ease;
}
.nn-gift-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
}
.nn-gift-popup__dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: nn-slide-up 0.25s ease;
}
.nn-gift-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
}
.nn-gift-popup__close:hover { color: #000; }
.nn-gift-popup__header {
  padding: 24px 24px 12px;
  border-bottom: 1px solid #eee;
}
.nn-gift-popup__header h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
}
.nn-gift-popup__header p {
  margin: 0;
  font-size: 14px;
  color: #666;
}
.nn-gift-popup__body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}
.nn-gift-popup__loading {
  text-align: center;
  padding: 40px;
  color: #999;
}
.nn-gift-popup__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.nn-gift-group {
  border-top: 1px solid #eee;
  padding-top: 14px;
}
.nn-gift-group:first-child {
  border-top: 0;
  padding-top: 0;
}
.nn-gift-group__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #222;
  letter-spacing: 0.3px;
}
.nn-gift-group__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.nn-gift-option {
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  background: #fff;
}
.nn-gift-option:hover {
  border-color: #1e6bd6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 107, 214, 0.15);
}
.nn-gift-option.is-selected {
  border-color: #1e6bd6;
  background: rgba(30, 107, 214, 0.05);
  box-shadow: 0 0 0 3px rgba(30, 107, 214, 0.2);
}
.nn-gift-option img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
}
.nn-gift-option__name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nn-gift-option__price {
  font-size: 11px;
  color: #999;
  text-decoration: line-through;
  margin-top: 2px;
}
.nn-gift-option__free {
  font-size: 11px;
  color: #2e7d32;
  font-weight: 700;
  margin-top: 2px;
}
.nn-gift-popup__footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.nn-btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.nn-btn--primary {
  background: #1e6bd6;
  color: #fff;
  border-color: #1e6bd6;
}
.nn-btn--primary:hover:not(:disabled) {
  background: #1558b0;
  border-color: #1558b0;
}
.nn-btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.nn-btn--ghost {
  background: transparent;
  color: #666;
  border-color: #ddd;
}
.nn-btn--ghost:hover { background: #f5f5f5; }

@keyframes nn-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nn-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .nn-gift-popup { padding: 0; }
  .nn-gift-popup__dialog {
    max-height: 100vh;
    border-radius: 12px 12px 0 0;
    margin-top: auto;
  }
  .nn-gift-group__items {
    grid-template-columns: repeat(2, 1fr);
  }
}
