/* Black Friday gift UI — aligned with PDF mockups */

.gift-hint {
  --bf-gift-green: #A5C592;
  --bf-gift-green-soft: #E8F2E1;
  --bf-gift-green-deep: #6F9A5C;
  margin: 0 0 12px;
  color: #2b2b2b;
  font-size: 13px;
  line-height: 1.45;
}

.gift-hint__panel {
  background: var(--bf-gift-green-soft);
  padding: 12px 14px;
}

.gift-hint__main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.gift-hint__icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--bf-gift-green-deep);
}

.gift-hint__icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.gift-hint__body {
  flex: 1 1 auto;
  min-width: 0;
}

.gift-hint__text {
  font-weight: 400;
  font-size: 13px;
  color: #2b2b2b;
}

.gift-hint__text strong {
  font-weight: 700;
}

.gift-hint__bar {
  margin-top: 10px;
  height: 3px;
  background: rgba(165, 197, 146, 0.35);
  overflow: hidden;
}

.gift-hint__progress {
  height: 100%;
  background: var(--bf-gift-green);
  transition: width .35s ease;
}

/* Second line — same panel, under the bar, full width (mockup 2a) */
.gift-hint__code {
  margin-top: 10px;
  padding-top: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #3d3d3d;
  /* Minicart (.xoo-cp / .popup) sets user-select:none — allow copying the code. */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.gift-hint__code strong,
.gift-hint__promo-code {
  font-weight: 700;
  color: #1f1f1f;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  cursor: text;
}

.gift-hint {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.gift-hint--code-only .gift-hint__code {
  margin-top: 0;
}

.bf-gift-hint-slot--cart {
  margin: 0 0 16px;
}

.gift-popup[hidden] {
  display: none !important;
}

.gift-popup {
  position: fixed;
  inset: 0;
  z-index: 1000001; /* above xoo minicart (100000) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gift-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
}

.gift-popup__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: #fff;
  padding: 32px 28px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  text-align: center;
}

.gift-popup__close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #333;
}

.gift-popup__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 18px;
  color: #1a1a1a;
}

.gift-popup__media {
  margin: 0 auto 16px;
  width: 180px;
  height: 180px;
}

.gift-popup__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gift-popup__gift-text {
  font-size: 15px;
  margin-bottom: 16px;
  color: #333;
}

.gift-popup__code-box {
  display: inline-block;
  border: 1px dashed #bdbdbd;
  padding: 10px 22px;
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  font-size: 18px;
  color: #1a1a1a;
}

.gift-popup__hint {
  font-size: 13px;
  color: #666;
  margin: 0 auto 18px;
  max-width: 320px;
  line-height: 1.4;
}

.gift-popup__copy,
.gift-popup-copy {
  display: inline-block;
  min-width: 240px;
  padding: 14px 22px;
  border: 0;
  border-radius: 4px;
  background: #A5C592;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .2s ease;
}

.gift-popup__copy:hover,
.gift-popup-copy:hover {
  background: #8fb37c;
}

.gift-popup__footer {
  margin-top: 14px;
  font-size: 12px;
  color: #888;
}

.cart_item.gift-item .card__checkout-quantity,
.cart_item.gift-item .product-quantity {
  display: none !important;
}

/* Virtual gift (JS/Redis HTML) — same look as cart gift, no remove/qty. */
.bf-gift-virtual .icon-trash,
.bf-gift-virtual .product__button-remove,
.bf-gift-virtual .card__checkout-quantity,
.bf-gift-virtual .quantity {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.bf-gift-virtual {
  pointer-events: none;
}

.bf-gift-virtual a {
  pointer-events: auto;
}

.gift-item__badge,
.cart-item-gift-label.gift-item__badge {
  display: inline-block;
  margin: 6px 0 2px;
  padding: 3px 8px;
  background: #A5C592;
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.gift-item__by-code {
  display: block;
  margin: 2px 0 0;
  color: #9d9d9d;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.product__header-desc.gift-item__label {
  display: block;
}

/*
 * Minicart: gift-hint eats vertical space; absolute .cart-total / .cart-shiping
 * (bottom:40px) then overlap products. Switch footer to normal flow while hint is on.
 */
.xoo-cp-modal .xoo-cp-content:has(.gift-hint) {
  display: flex;
  flex-direction: column;
}

.xoo-cp-modal .xoo-cp-content:has(.gift-hint) > .gift-hint {
  flex: 0 0 auto;
  margin: 0 0 10px;
}

.xoo-cp-modal .xoo-cp-content:has(.gift-hint) .product-list-wrap {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 8px;
}

.xoo-cp-modal .xoo-cp-content:has(.gift-hint) .product-list.compact.test-b {
  max-height: min(200px, 26vh) !important;
}

.xoo-cp-modal .xoo-cp-content:has(.gift-hint) .cart-bottom.test-b {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  height: auto !important;
  margin: 8px 0 0;
  padding-top: 12px;
  border-top: 1px solid #ebebeb;
  background: #fff;
  z-index: 5;
  flex: 0 0 auto;
}

.xoo-cp-modal .xoo-cp-content:has(.gift-hint) .cart-shiping.test-b,
.xoo-cp-modal .xoo-cp-content:has(.gift-hint) .cart-total.test-b {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
  width: 48%;
  background: #fff;
  z-index: 6;
  align-self: flex-end;
  padding: 0;
}

.xoo-cp-modal .xoo-cp-content:has(.gift-hint) .cart-total.test-b p {
  overflow: hidden;
  margin: 0 0 6px;
  line-height: 1.35;
}

.xoo-cp-modal .xoo-cp-content:has(.gift-hint) .cart-total.test-b p:last-child {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .gift-popup {
    padding: 16px;
  }

  .gift-popup__dialog {
    max-width: none;
    width: 100%;
  }

  .gift-hint__text {
    font-size: 12px;
  }

  .xoo-cp-modal .xoo-cp-content:has(.gift-hint) .product-list.compact.test-b {
    max-height: min(36vh, 240px) !important;
  }

  .xoo-cp-modal .xoo-cp-content:has(.gift-hint) .cart-bottom.test-b {
    flex-direction: column;
    align-items: stretch;
  }

  .xoo-cp-modal .xoo-cp-content:has(.gift-hint) .cart-shiping.test-b,
  .xoo-cp-modal .xoo-cp-content:has(.gift-hint) .cart-total.test-b {
    width: 100%;
  }

  .xoo-cp-modal .xoo-cp-content:has(.gift-hint) .cart-total.test-b {
    margin-top: 12px;
  }
}
