/* ============ #gift — Hộp mừng cưới (chạm hộp mới hiện QR) ============ */
#gift {
  text-align: center;
  background:
    radial-gradient(90% 50% at 50% 100%, rgba(237,230,216,.45), transparent 70%),
    var(--cream);
}
#gift .gift-ribbon {
  position: absolute; top: 0; left: 50%; width: 1px; height: 48px;
  background: linear-gradient(var(--gold-light), transparent);
}
#gift .gift-kicker {
  margin: 0 0 6px; font-family: var(--font-sans); font-size: 11px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep);
}
#gift .gift-title { margin: 0; font-size: clamp(44px, 13vw, 58px); line-height: 1.25; padding: 0 .15em; }
#gift .gift-note {
  margin: 10px auto 0; max-width: 340px;
  font-size: 18px; line-height: 1.55; font-style: italic; color: var(--ink-soft);
}

/* ---------- 2 hộp quà ---------- */
#gift .gift-boxes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 30px auto 0; max-width: 400px;
}
#gift .gift-boxes.is-single { grid-template-columns: minmax(0, 220px); justify-content: center; }
#gift .gift-box-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; width: 100%;
  padding: 18px 8px 16px; border: 0; border-radius: 16px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.9), transparent 60%),
    linear-gradient(160deg, #FFFDF8 0%, #F4EBDA 100%);
  box-shadow: 0 0 0 1px rgba(184,137,59,.35), 0 18px 34px -22px rgba(138,98,36,.6);
  -webkit-tap-highlight-color: transparent;
  transition: transform .35s var(--ease-out), box-shadow .35s;
}
#gift .gift-box-btn::after { /* khung chỉ vàng */
  content: ""; position: absolute; inset: 7px; border: 1px solid rgba(184,137,59,.35); border-radius: 11px; pointer-events: none;
}
#gift .gift-box-btn:active { transform: scale(.97); }
#gift .gift-box-btn:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
#gift .gift-pkg { width: 100%; max-width: 132px; height: auto; overflow: visible; }
#gift .gift-pkg-lid { transform-box: view-box; transform-origin: 26px 68px; transition: transform .6s var(--ease-out); }
#gift .gift-pkg-glow { opacity: 0; transition: opacity .5s; }
/* lắc nhẹ mời gọi */
#gift .gift-box-wrap:nth-child(1) .gift-pkg-lid { animation: giftNudge 5s 1.5s ease-in-out infinite; }
#gift .gift-box-wrap:nth-child(2) .gift-pkg-lid { animation: giftNudge 5s 4s ease-in-out infinite; }
@keyframes giftNudge { 0%, 86%, 100% { transform: none; } 90% { transform: translateY(-3px) rotate(-2deg); } 95% { transform: translateY(-1px) rotate(1deg); } }
#gift .gift-box-btn.is-open .gift-pkg-lid { animation: none; transform: translate(-6px, -22px) rotate(-16deg); }
#gift .gift-box-btn.is-open .gift-pkg-glow { opacity: 1; }
#gift .gift-box-side { margin-top: 4px; font-size: 34px; line-height: 1.2; padding: 0 .12em; }
#gift .gift-box-hint {
  margin: 16px 0 0; font-family: var(--font-sans); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-deep);
}

/* ---------- tấm thẻ QR (gắn vào body) ---------- */
.gift-sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gift-sheet[hidden] { display: none; }
.gift-sheet-scrim {
  position: absolute; inset: 0; background: rgba(43,36,28,.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .35s;
}
.gift-sheet-card {
  position: relative; width: 100%; max-width: 330px; padding: 30px 22px 24px; text-align: center;
  border-radius: 18px; outline: none;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,.95), transparent 60%),
    linear-gradient(165deg, #FFFDF8 0%, #F3E9D6 100%);
  box-shadow: 0 0 0 1px rgba(184,137,59,.45), 0 30px 60px -20px rgba(43,36,28,.55);
  opacity: 0; transform: translateY(40px) scale(.96);
  transition: opacity .38s var(--ease-out), transform .5s var(--ease-out);
  font-family: var(--font-serif); color: var(--ink);
}
.gift-sheet-card::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(184,137,59,.45); border-radius: 12px; pointer-events: none; }
.gift-sheet.is-on .gift-sheet-scrim { opacity: 1; }
.gift-sheet.is-on .gift-sheet-card { opacity: 1; transform: none; }
.gift-sheet .gift-corner { position: absolute; width: 20px; height: 20px; border: 1px solid #B8893B; pointer-events: none; }
.gift-sheet .gift-corner--tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.gift-sheet .gift-corner--br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.gift-sheet-x {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; padding: 10px;
  border: 0; border-radius: 50%; background: transparent; color: #6E6255;
}
.gift-sheet-x svg { width: 20px; height: 20px; }
.gift-sheet-x:focus-visible, .gift-sheet .gift-copy:focus-visible { outline: 2px solid #8C672D; outline-offset: 2px; }
.gift-sheet p { margin: 0; }
.gift-sheet-no { font-family: var(--font-sans); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: #8A6224; }
.gift-sheet-title { margin: 0; font-size: 40px; line-height: 1.2; padding: 0 .12em; font-weight: 400; }
.gift-sheet .gift-qr { width: 184px; margin: 10px auto 14px; }
.gift-sheet .gift-qr-img, .gift-sheet .gift-qr-svg {
  width: 184px; height: 184px; border-radius: 10px; background: #fff;
  box-shadow: 0 0 0 1px rgba(184,137,59,.45), 0 10px 22px -12px rgba(59,51,43,.45);
}
.gift-sheet .gift-qr-fake[hidden] { display: none; }
.gift-sheet .gift-qr-label {
  display: block; margin-top: 6px; font-family: var(--font-sans); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: #6E6255;
}
.gift-sheet .gift-info-bank { font-family: var(--font-sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #8A6224; }
.gift-sheet .gift-info-num { margin-top: 4px; font-family: var(--font-display); font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.gift-sheet .gift-info-name { margin-top: 2px; font-family: var(--font-sans); font-size: 12px; letter-spacing: .1em; color: #6E6255; }
.gift-sheet .gift-copy {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 16px; min-height: 44px; padding: 10px 20px;
  border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #7A5520 0%, #9C722F 50%, #8A6224 100%); color: #fff;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; letter-spacing: .06em;
  box-shadow: 0 10px 18px -10px rgba(138,98,36,.8);
  transition: transform .2s;
}
.gift-sheet .gift-copy svg { width: 16px; height: 16px; }
.gift-sheet .gift-copy:active { transform: scale(.95); }
.gift-sheet .gift-copy.is-done { animation: giftPulse .6s var(--ease-out); }
@keyframes giftPulse { 40% { transform: scale(1.08); } }
html.gift-lock, html.gift-lock body { overflow: hidden; }

@media (max-width: 340px) {
  #gift .gift-boxes { gap: 10px; }
  #gift .gift-box-side { font-size: 28px; }
  .gift-sheet .gift-qr, .gift-sheet .gift-qr-img, .gift-sheet .gift-qr-svg { width: 160px; }
  .gift-sheet .gift-qr-img, .gift-sheet .gift-qr-svg { height: 160px; }
}

/* toast (appended to body) */
#gift-toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 90;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 40px);
  padding: 10px 18px; border-radius: 999px;
  background: rgba(59,51,43,.92); color: #FFFDF8;
  font-family: var(--font-sans); font-size: 13.5px; text-align: center;
  box-shadow: 0 10px 24px -10px rgba(59,51,43,.6);
  transition: opacity .3s, transform .4s var(--ease-out);
}
#gift-toast.is-ok::before { content: "✓ "; color: var(--gold-light); }
#gift-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
