/* ========================================================
   9. GIFT BOX & MODAL (HỘP MỪNG CƯỚI)
   ======================================================== */
.gift-section {
  position: relative;
  text-align: center;
  padding: 16px 20px 8px;
  overflow: visible;
}

.gift-section::before {
  display: none !important;
}

.gift-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gift-heading {
  font-family: var(--font-title);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #3B4C31;
  text-align: center;
  margin: 0 0 8px;
}

.gift-envelope-trigger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none !important;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0 auto;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.gift-envelope-box {
  position: relative;
  display: inline-block;
  width: 215px;
  max-width: 75vw;
  margin: 0 auto;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.gift-envelope-img {
  width: 100%;
  height: auto;
  display: block;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  filter: drop-shadow(0 10px 22px rgba(81, 20, 25, 0.2));
  animation: giftEnvelopeFloat 3.8s ease-in-out infinite alternate;
  transform-origin: center bottom;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.35s ease;
}

.gift-envelope-trigger:hover .gift-envelope-img {
  transform: translateY(-8px) scale(1.04) rotate(1.5deg);
  filter: drop-shadow(0 16px 30px rgba(81, 20, 25, 0.3));
}

@keyframes giftEnvelopeFloat {
  0% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-9px) rotate(1.5deg);
  }
  100% {
    transform: translateY(-4px) rotate(-0.5deg);
  }
}

.gift-sparkle {
  position: absolute;
  pointer-events: none;
  color: #d4af37;
  font-size: 1rem;
  line-height: 1;
  text-shadow: 0 0 6px rgba(212, 175, 55, 0.6);
  animation: giftSparkleTwinkle 2.6s ease-in-out infinite;
}

.gift-sparkle-1 {
  top: 18%;
  right: 14%;
  animation-delay: 0s;
}

.gift-sparkle-2 {
  top: 36%;
  left: 12%;
  font-size: 0.85rem;
  animation-delay: 1.3s;
}

@keyframes giftSparkleTwinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.25) rotate(15deg);
  }
}

.gift-hint-text {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #3B4C31;
  margin-top: 6px;
  letter-spacing: .04em;
  transition: all 0.2s ease;
}

.gift-envelope-trigger:hover .gift-hint-text {
  color: #4b6040;
  transform: translateY(-1px);
}

.gift-thankyou-text {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.16rem;
  font-weight: 600;
  font-style: italic;
  color: #3B4C31;
  text-align: center;
  margin: 10px auto 0;
  max-width: 100%;
  width: auto;
  line-height: 1.5;
}

.gift-brand-footer {
  font-family: var(--font-sans), 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: #8c5d63;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: none;
  margin-top: 28px;
  margin-bottom: 0;
  opacity: 0.55;
  line-height: 1.4;
}

/* Modal Hộp Quà Mừng */
.gift-modal-box {
  background: #fcf8f2;
  border-radius: 18px;
  overflow: hidden;
  width: 92%;
  max-width: 540px;
  max-height: calc(100dvh - 32px);
  margin: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 48px rgba(40, 10, 15, 0.35);
  border: 1px solid rgba(81, 20, 25, 0.15);
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.gift-modal-header {
  background: #3B4C31;
  color: #ffffff;
  padding: 12px 20px;
  position: relative;
  text-align: center;
  flex-shrink: 0;
}

.gift-modal-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: #ffffff;
  margin: 0;
  text-transform: uppercase;
}

.gift-modal-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.gift-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.gift-modal-body {
  padding: 16px 16px 18px;
  background: #fbf8f2;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.gift-cols-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Chỉ còn 1 bên có QR: căn giữa */
.gift-cols-container.single-col {
  grid-template-columns: 1fr;
  justify-items: center;
}

.gift-person-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gift-person-title {
  display: none !important;
}

.gift-qr-card {
  background: #ffffff;
  padding: 9px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(59, 76, 49, 0.08);
  border: 1px solid rgba(59, 76, 49, 0.12);
  width: 136px;
  height: 136px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.gift-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gift-bank-info {
  margin-bottom: 9px;
}

.gift-bank-name {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #3B4C31;
  font-weight: 600;
  margin-bottom: 2px;
}

.gift-bank-number {
  font-family: "Lora", monospace;
  font-size: 0.94rem;
  font-weight: 700;
  color: #3B4C31;
  letter-spacing: .05em;
  margin-bottom: 2px;
  font-variant-numeric: lining-nums tabular-nums;
}

.gift-bank-owner {
  font-family: var(--font-title);
  font-size: 0.76rem;
  font-weight: 700;
  color: #3B4C31;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.gift-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.btn-copy-acc,
.btn-save-qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 16px;
  border-radius: 999px;
  background: #eef3eb;
  border: 1px solid #cdd8c8;
  color: #3B4C31;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.btn-copy-acc {
  background: #edf2ea;
  border: 1px solid #cbd7c6;
}

.btn-copy-acc:hover,
.btn-save-qr:hover {
  background: #3B4C31;
  color: #ffffff;
  border-color: #3B4C31;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(59, 76, 49, 0.25);
}

.btn-copy-acc:active,
.btn-save-qr:active {
  transform: scale(0.96);
}

@media (max-width: 520px) {
  .gift-modal-box {
    width: 95%;
    max-height: calc(100dvh - 20px);
    border-radius: 14px;
  }

  .gift-modal-header {
    padding: 13px 18px;
  }

  .gift-modal-title {
    font-size: 1.05rem;
  }

  .gift-modal-body {
    padding: 18px 16px 20px;
  }

  .gift-cols-container {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .gift-person-card {
    padding: 4px 0;
  }

  .gift-qr-card {
    width: 120px;
    height: 120px;
    padding: 7px;
    border-radius: 11px;
    margin-bottom: 7px;
  }

  .gift-bank-info {
    margin-bottom: 7px;
  }

  .gift-bank-name {
    font-size: 0.76rem;
    margin-bottom: 2px;
  }

  .gift-bank-number {
    font-size: 0.90rem;
    margin-bottom: 2px;
  }

  .gift-bank-owner {
    font-size: 0.74rem;
  }

  .gift-actions-row {
    gap: 7px;
  }

  .btn-copy-acc,
  .btn-save-qr {
    padding: 5px 13px;
    font-size: 0.73rem;
  }
}

@media (max-width: 360px) {
  .gift-qr-card {
    width: 108px;
    height: 108px;
    padding: 6px;
  }

  .gift-modal-body {
    padding: 14px 10px 16px;
  }

  .gift-cols-container {
    gap: 14px;
  }
}
