/* ========================================================
   9. GIFT BOX & MODAL (HỘP MỪNG CƯỚI - BLUE WATERCOLOR THEME)
   ======================================================== */
.gift-section,
.gift-block-c3 {
  position: relative;
  text-align: center;
  padding: 36px 16px 40px;
  overflow: visible;
}

.gift-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.gift-heading {
  font-family: 'Playfair Display', var(--font-title), Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #153353;
  text-align: center;
  margin: 0 0 18px;
}

/* GIFT ENVELOPE / BOX TRIGGER */
.gift-envelope-trigger,
.gift-illustration-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none !important;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 12px auto 0;
  position: relative;
  -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: 220px;
  max-width: 75vw;
  margin: 0 auto;
}

.gift-box-watercolor-img,
.gift-envelope-img {
  width: 210px;
  max-width: 75vw;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 28px rgba(21, 51, 83, 0.15));
  animation: giftBoxFloatAnim 4.2s 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;
  -webkit-user-drag: none;
}

.gift-illustration-card:hover .gift-box-watercolor-img,
.gift-envelope-trigger:hover .gift-envelope-img {
  transform: translateY(-10px) scale(1.05) rotate(1.2deg);
  filter: drop-shadow(0 20px 36px rgba(21, 51, 83, 0.25));
}

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

.gift-box-custom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 34px;
  margin-top: 14px;
  border-radius: 9999px;
  background: linear-gradient(180deg, #4d739e 0%, #3b608c 100%);
  color: #ffffff;
  font-family: 'Montserrat', var(--font-sans), sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  box-shadow: 0 4px 14px rgba(43, 75, 114, 0.28);
  cursor: pointer;
  transition: all 0.25s ease;
}

.gift-illustration-card:hover .gift-box-custom-btn,
.gift-box-custom-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(43, 75, 114, 0.38);
  background: linear-gradient(180deg, #5b83b0 0%, #446d9c 100%);
  color: #ffffff;
}

.gift-box-ambient-sparkles {
  position: absolute;
  inset: -10px;
  pointer-events: none;
}

.ambient-sparkle {
  position: absolute;
  color: #c49a45;
  font-size: 1rem;
  line-height: 1;
  text-shadow: 0 0 8px rgba(196, 154, 69, 0.5);
  animation: giftSparkleTwinkle 2.8s ease-in-out infinite;
}

.ambient-sparkle.s1 {
  top: 15%;
  right: 12%;
  animation-delay: 0s;
}

.ambient-sparkle.s2 {
  top: 45%;
  left: 10%;
  font-size: 0.85rem;
  animation-delay: 1.2s;
}

.ambient-sparkle.s3 {
  bottom: 25%;
  right: 14%;
  font-size: 0.75rem;
  animation-delay: 2s;
}

@keyframes giftSparkleTwinkle {
  0%, 100% {
    opacity: 0.25;
    transform: scale(0.8) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.3) rotate(20deg);
  }
}

.gift-hint-text {
  font-family: 'Playfair Display', var(--font-title), Georgia, serif;
  font-size: 1.05rem;
  font-weight: 500;
  font-style: italic;
  color: #25456f;
  margin: 14px 0 0;
  letter-spacing: .02em;
  text-align: center;
}

.gift-thankyou-text,
.gift-thankyou-note {
  font-family: 'Playfair Display', var(--font-title), Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  font-style: italic;
  color: #25456f;
  text-align: center;
  margin: 24px auto 10px;
  max-width: 440px;
  line-height: 1.5;
}

.gift-brand-footer {
  font-family: 'Montserrat', var(--font-sans), sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6887ad;
  text-align: center;
  letter-spacing: .08em;
  margin-top: 8px;
}

/* ========================================================
   MODAL HỘP QUÀ MỪNG (EXACT MATCH USER REFERENCE)
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(18, 38, 62, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.gift-modal-box {
  background-color: #f7fafc;
  background-image:
    linear-gradient(180deg, rgba(232, 240, 248, 0.72) 0%, rgba(247, 250, 252, 0.55) 40%, rgba(247, 250, 252, 0.45) 100%),
    url('../assets/19297e3c-5878-4682-a4b2-2a0b6ac07a7e.png');
  background-position: center, center;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  border-radius: 26px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 388px;
  max-height: calc(100dvh - 36px);
  margin: auto;
  display: flex;
  flex-direction: column;
  padding: 18px 16px 22px;
  box-shadow: 0 16px 48px rgba(15, 33, 56, 0.22);
  border: 1px solid rgba(165, 186, 209, 0.45);
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

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

/* Header bar — tông xanh nhạt (đồng bộ theme xanh) */
.gift-modal-header {
  background: #eef3f8;
  border-radius: 6px;
  padding: 10px 14px 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.gift-modal-title {
  font-family: 'Playfair Display', var(--font-title), Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .16em;
  color: #274363;
  margin: 0;
  text-transform: uppercase;
}

/* Circular outline close button */
.gift-modal-close {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  border-radius: 50%;
  border: 1.2px solid #7c9ebd;
  background: transparent;
  color: #3b5f85;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.2s ease;
}

.gift-modal-close:hover {
  background: #3b5f85;
  color: #ffffff;
  border-color: #3b5f85;
}

.gift-modal-body {
  padding: 0;
  background: transparent;
  overflow: visible;
}

/* 1 Column stack as shown in design reference */
.gift-cols-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
  align-items: stretch !important;
}

/* Chỉ còn 1 bên có QR/STK — căn giữa */
.gift-cols-container.single-col {
  align-items: center !important;
}

.gift-cols-container.single-col .gift-person-card {
  width: 100% !important;
  max-width: 300px !important;
}

.gift-person-card {
  background: #ffffff !important;
  border: 1px solid #c7d8e6 !important;
  border-radius: 18px !important;
  padding: 20px 16px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  box-shadow: 0 4px 16px rgba(21, 51, 83, 0.04) !important;
  box-sizing: border-box !important;
}

/* Không có QR → ẩn hẳn (ghi đè display:flex !important) */
.gift-person-card.is-empty {
  display: none !important;
}

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

.gift-qr-card {
  width: 175px !important;
  height: 175px !important;
  border: 1px solid #d4e2ee !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  padding: 8px !important;
  margin: 0 auto 12px auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(21, 51, 83, 0.03) !important;
  box-sizing: border-box !important;
}

.gift-qr-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
  border-radius: 8px !important;
}

.gift-bank-info {
  margin-bottom: 14px !important;
  text-align: center !important;
}

.gift-bank-name {
  font-family: 'Playfair Display', var(--font-title), Georgia, serif !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.16em !important;
  color: #557799 !important;
  text-transform: uppercase !important;
  margin-bottom: 4px !important;
}

.gift-bank-number {
  font-family: 'Playfair Display', var(--font-title), Georgia, serif !important;
  font-size: 1.32rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  color: #1a385a !important;
  margin-bottom: 4px !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
}

.gift-bank-owner {
  font-family: 'Playfair Display', var(--font-title), Georgia, serif !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.15em !important;
  color: #3b5d80 !important;
  text-transform: uppercase !important;
}

.gift-actions-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  margin-top: 2px !important;
}

.btn-copy-acc {
  background: #5b7f9f !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 9999px !important;
  padding: 7px 18px !important;
  font-family: 'Montserrat', var(--font-sans), sans-serif !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 6px rgba(91, 127, 159, 0.25) !important;
}

.btn-copy-acc svg {
  stroke: #ffffff !important;
}

.btn-copy-acc:hover {
  background: #476a89 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(91, 127, 159, 0.35) !important;
}

.btn-save-qr {
  background: #ffffff !important;
  color: #33506d !important;
  border: 1px solid #7c9ebd !important;
  border-radius: 9999px !important;
  padding: 6px 18px !important;
  font-family: 'Montserrat', var(--font-sans), sans-serif !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}

.btn-save-qr svg {
  stroke: #33506d !important;
}

.btn-save-qr:hover {
  background: #f0f5fa !important;
  transform: translateY(-1px) !important;
}

@media (max-width: 480px) {
  .gift-modal-box {
    width: calc(100% - 20px);
    padding: 16px 14px 20px;
    border-radius: 22px;
  }

  .gift-modal-header {
    padding: 8px 12px 8px 14px;
    margin-bottom: 14px;
  }

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

  .gift-qr-card {
    width: 155px !important;
    height: 155px !important;
  }

  .gift-bank-number {
    font-size: 1.22rem !important;
  }
}
