/* ==============================================================================
   MẪU 03: ĐỎ MẬN HOÀNG GIA (BURGUNDY LUXURY ROYAL)
   Hệ thống thiệp cưới trực tuyến thiepcuoivn.site
   ============================================================================== */

:root,
html[data-palette="do-man"] {
  --bg-primary: #490816;
  --bg-primary-dark: #380510;
  --bg-paper: #ffffff;
  --bg-paper-alt: #fbf8f6;
  --bg-soft-tint: #fcf4f5;
  --text-light: #ffffff;
  --text-dark: #241417;
  --text-muted: #6b585c;
  --gold: #d4af37;
  --gold-light: #f3df95;
  --gold-dark: #a6841f;
  --border-tint: rgba(73, 8, 22, 0.12);
  --border-gold: rgba(212, 175, 55, 0.4);
  --shadow-sm: 0 4px 15px rgba(73, 8, 22, 0.06);
  --shadow-md: 0 10px 30px rgba(73, 8, 22, 0.12);
  --shadow-lg: 0 18px 45px rgba(73, 8, 22, 0.2);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
}

html[data-palette="kem"] {
  --bg-primary: #751325;
  --bg-primary-dark: #520916;
  --bg-paper: #fcf9f5;
  --bg-paper-alt: #f5eee6;
  --bg-soft-tint: #f7eee7;
  --text-light: #ffffff;
  --text-dark: #2b171a;
  --text-muted: #6e5954;
  --gold: #c59b27;
  --gold-light: #eed17c;
  --gold-dark: #9e7610;
  --border-tint: rgba(117, 19, 37, 0.12);
  --border-gold: rgba(197, 155, 39, 0.4);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: #24040b;
}

body {
  font-family: 'Montserrat', 'Roboto', sans-serif;
  color: var(--text-dark);
  background-color: #24040b;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Ảnh mờ nhẹ rồi nét dần khi tải xong, che độ trễ mạng chậm */
img[loading="lazy"] { filter: blur(10px); transition: filter .5s ease; }
img[loading="lazy"].loaded { filter: none; }

button, input, textarea, select {
  font: inherit;
}

/* Typography Helpers */
/* Cormorant SC mặc định dùng số kiểu cổ (cao thấp so le); ngày tháng và đồng hồ dùng số thẳng hàng */
.hero-date-banner span, .strip-num, .cd-val, .event-date-large {
  font-variant-numeric: lining-nums;
}

.script {
  font-family: 'Ephesis', 'Pinyon Script', cursive;
}

/* Fall decoration (falling golden sparkles) */
.fall {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  overflow: hidden;
}

.fall i {
  position: absolute;
  top: -20px;
  color: var(--gold-light);
  font-style: normal;
  user-select: none;
  animation: fallDown linear infinite;
  opacity: 0.65;
  filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.5));
}

@keyframes fallDown {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  15% { opacity: 0.8; }
  85% { opacity: 0.8; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fall { display: none; }
  .reveal, .reveal-left, .reveal-right { opacity: 1; transform: none; transition: none; }
  .btn-submit-rsvp { animation: none; }
  img[loading="lazy"] { filter: none; transition: none; }
}

/* Main Container Frame */
.card {
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-paper);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

/* Reveal on Scroll Effect */
.reveal, .reveal-left, .reveal-right {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}

.reveal {
  transform: translateY(24px);
}

.reveal-left {
  transform: translateX(-30px);
}

.reveal-right {
  transform: translateX(30px);
}

.js .active {
  opacity: 1;
  transform: translate(0, 0);
}

/* --------------------------------------------------------------------------
   1. HERO SECTION (BÌA MỞ ĐẦU HOÀNG GIA)
   -------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(170deg, var(--bg-primary) 0%, var(--bg-primary-dark) 100%);
  color: var(--text-light);
  padding: 48px 24px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--border-gold);
  pointer-events: none;
  border-radius: var(--radius-sm);
}

.hero-subtitle {
  font-family: 'Cormorant SC', serif;
  font-size: 0.82rem;
  letter-spacing: 7px;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 8px;
  display: block;
}

.hero-title {
  font-family: 'Ephesis', cursive;
  font-size: 2.2rem;
  color: var(--text-light);
  line-height: 1.1;
  margin-bottom: 24px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Rotated photo stamp */
.hero-stamp-wrap {
  position: relative;
  width: 220px;
  height: 290px;
  margin: 0 auto 28px;
}

.hero-stamp {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 5px solid #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  transform: rotate(-2deg);
  transition: transform 0.4s ease;
}

.hero-stamp:hover {
  transform: rotate(0deg) scale(1.02);
}

.hero-stamp-badge {
  position: absolute;
  bottom: -15px;
  right: -15px;
  background: var(--gold);
  color: var(--bg-primary-dark);
  font-family: 'Cormorant SC', serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 6px 14px;
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  border: 1px solid #fff;
  text-transform: uppercase;
}

.hero-names {
  font-family: 'Ephesis', 'Pinyon Script', cursive;
  font-size: 3.2rem;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 12px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.hero-names span.amp {
  font-size: 2rem;
  color: var(--gold-light);
  display: inline-block;
  margin: 0 4px;
}

/* Mỗi tên giữ trên một dòng, chỉ xuống dòng quanh dấu & */
.hero-names > span:not(.amp) {
  white-space: nowrap;
}

.hero-date-banner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 8px 20px;
  border-radius: 40px;
  margin-top: 10px;
}

.hero-date-banner span {
  font-family: 'Cormorant SC', serif;
  font-size: 0.95rem;
  letter-spacing: 2px;
  color: #ffffff;
  font-weight: 600;
}

.hero-lunar {
  font-size: 0.82rem;
  color: var(--gold-light);
  font-style: italic;
  margin-top: 8px;
}

/* Lời mời: tên khách mời viết tay ngay dưới ảnh bìa */
.invite-section {
  padding: 38px 24px 0;
  background-color: var(--bg-paper);
  text-align: center;
}

.invite-section .sec-sub {
  margin-bottom: 4px;
}

.invite-guest {
  font-family: 'Ephesis', 'Pinyon Script', cursive;
  font-size: 2.7rem;
  line-height: 1.15;
  color: var(--bg-primary);
}

.invite-text {
  margin-top: 6px;
  font-size: 0.92rem;
  color: var(--text-muted);
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   2. GIA ĐÌNH HAI BÊN & CHÚ RỂ - CÔ DÂU
   -------------------------------------------------------------------------- */
.couple-family {
  padding: 44px 24px;
  background-color: var(--bg-paper);
  text-align: center;
}

.sec-heading {
  font-family: 'Ephesis', cursive;
  font-size: 2.6rem;
  color: var(--bg-primary);
  margin-bottom: 6px;
  line-height: 1;
}

.sec-sub {
  font-family: 'Cormorant SC', serif;
  font-size: 0.78rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 28px;
  text-wrap: balance;
}

.family-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
  position: relative;
}

.family-col {
  padding: 18px 12px;
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-tint);
  border-radius: var(--radius-md);
  position: relative;
}

.family-col h3 {
  font-family: 'Cormorant SC', serif;
  font-size: 0.88rem;
  text-transform: uppercase;
  color: var(--bg-primary);
  letter-spacing: 2px;
  margin-bottom: 12px;
  font-weight: 700;
}

.family-col p {
  font-size: 0.88rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.family-col .parent-role {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.family-col .fam-addr {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Couple Cards */
.couple-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.couple-card {
  text-align: center;
}

.couple-photo-wrap {
  width: 100%;
  aspect-ratio: 1/1.25;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border: 3px solid #ffffff;
  outline: 1px solid var(--border-tint);
}

.couple-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.couple-photo-wrap:hover img {
  transform: scale(1.05);
}

.couple-role {
  font-family: 'Ephesis', cursive;
  font-size: 1.8rem;
  color: var(--bg-primary);
  line-height: 1;
}

.couple-name {
  font-family: 'Cormorant SC', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   3. CẶP ẢNH CHÂN DUNG SONG SONG (PORTRAITS DUO)
   -------------------------------------------------------------------------- */
.portraits-duo {
  padding: 0 20px 40px;
  background-color: var(--bg-paper);
}

.duo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.duo-img-box {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.duo-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.duo-img-box:hover img {
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   4. DẢI ẢNH LỊCH NGÀY CƯỚI & COUNTDOWN
   -------------------------------------------------------------------------- */
.strip-section {
  padding: 36px 20px;
  background: var(--bg-soft-tint);
  border-top: 1px solid var(--border-tint);
  border-bottom: 1px solid var(--border-tint);
  text-align: center;
}

.strip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

.strip-item {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background-color: var(--bg-primary);
}

.strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9);
}

.strip-badge {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  background: linear-gradient(to top, rgba(73, 8, 22, 0.95), rgba(73, 8, 22, 0.4) 70%, transparent);
  color: #ffffff;
  padding: 14px 4px 6px;
  text-align: center;
}

.strip-num {
  font-family: 'Cormorant SC', serif;
  font-size: 1.6rem;
  font-weight: 700;
  display: block;
  line-height: 1;
}

.strip-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold-light);
}

/* Countdown */
.countdown-box {
  background: var(--bg-primary);
  color: #ffffff;
  padding: 24px 16px;
  border-radius: var(--radius-md);
  margin-top: 8px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-gold);
}

.countdown-title {
  font-family: 'Ephesis', cursive;
  font-size: 1.9rem;
  color: var(--gold-light);
  margin-bottom: 14px;
  text-wrap: balance;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.cd-unit {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  min-width: 60px;
}

.cd-val {
  font-family: 'Cormorant SC', serif;
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
  line-height: 1;
  color: #ffffff;
}

.cd-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold-light);
  margin-top: 4px;
  display: block;
}

/* --------------------------------------------------------------------------
   5. EVENTS / TIMELINE LỄ CƯỚI
   -------------------------------------------------------------------------- */
.events-section {
  padding: 44px 20px;
  background-color: var(--bg-paper);
  text-align: center;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.event-card {
  background: var(--bg-paper-alt);
  border: 1px solid var(--border-tint);
  border-radius: var(--radius-md);
  padding: 26px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.event-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--bg-primary), var(--gold));
}

.event-title {
  font-family: 'Cormorant SC', serif;
  font-size: 1.25rem;
  color: var(--bg-primary);
  margin-bottom: 12px;
  font-weight: 700;
}

.event-time {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.event-time b {
  color: var(--bg-primary);
  font-weight: 600;
}

.event-date-large {
  font-family: 'Cormorant SC', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bg-primary);
  margin: 6px 0;
}

.event-lunar {
  font-size: 0.85rem;
  color: var(--gold-dark);
  font-style: italic;
  margin-bottom: 14px;
}

.event-place {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.event-addr {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 18px;
}

.btn-map {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-primary);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(73, 8, 22, 0.2);
}

.btn-map:hover {
  background: var(--bg-primary-dark);
  transform: translateY(-2px);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   6. RSVP FORM & SỔ LỜI CHÚC
   -------------------------------------------------------------------------- */
.rsvp-section {
  padding: 44px 20px;
  background: linear-gradient(rgba(73, 8, 22, 0.88), rgba(73, 8, 22, 0.95)), var(--bg-primary);
  color: #ffffff;
  text-align: center;
}

.rsvp-section .sec-heading {
  color: var(--gold-light);
}

.rsvp-section .sec-sub {
  color: rgba(255, 255, 255, 0.8);
}

.rsvp-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  margin-bottom: 24px;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.rsvp-form input,
.rsvp-form textarea,
.rsvp-form select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-dark);
  font-size: 0.9rem;
}

.rsvp-form input:focus,
.rsvp-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #ffffff;
}

.rsvp-radio-group {
  background: rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rsvp-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #ffffff;
  cursor: pointer;
}

/* Nút tròn giữ cỡ riêng, không theo kiểu ô nhập rộng 100% ở trên */
.rsvp-radio-label input {
  width: auto;
  flex: none;
  padding: 0;
  accent-color: var(--gold);
}

.btn-submit-rsvp {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-primary-dark);
  border: none;
  padding: 14px;
  border-radius: 30px;
  font-family: 'Cormorant SC', serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  margin-top: 6px;
}

.btn-submit-rsvp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* Nút gửi lời chúc "thở" nhẹ để mời bấm; dừng lại khi hover/disabled để không giật với hiệu ứng nhấc lên */
.btn-submit-rsvp { animation: pulse 2.6s ease-in-out infinite; }
.btn-submit-rsvp:hover, .btn-submit-rsvp:disabled { animation-play-state: paused; }
@keyframes pulse { 50% { transform: scale(1.03); } }

.form-status {
  margin-top: 10px;
  font-size: 0.85rem;
  min-height: 20px;
}

/* Sổ lời chúc */
.wishes-board {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: left;
}

.wishes-title {
  font-family: 'Ephesis', cursive;
  font-size: 2rem;
  color: var(--gold-light);
  text-align: center;
  margin-bottom: 16px;
}

.wishes-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 6px;
}

.wish-item {
  background: rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.wish-author {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gold-light);
  margin-bottom: 3px;
}

.wish-content {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   7. MỪNG CƯỚI (GIFT SECTION)
   -------------------------------------------------------------------------- */
.gift-section {
  padding: 40px 20px;
  background-color: var(--bg-paper);
  text-align: center;
}

.btn-open-gift {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  color: #ffffff;
  padding: 14px 28px;
  border-radius: 40px;
  font-family: 'Cormorant SC', serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid var(--border-gold);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.btn-open-gift:hover {
  background: var(--bg-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(73, 8, 22, 0.3);
}

/* --------------------------------------------------------------------------
   8. ALBUM HÌNH CƯỚI (GALLERY)
   -------------------------------------------------------------------------- */
.gallery-section {
  padding: 40px 16px;
  background-color: var(--bg-paper-alt);
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1/1.25;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  box-shadow: var(--shadow-sm);
}

/* Ảnh ngang và ảnh cuối khi số ảnh lẻ (server gắn class) trải cả hàng */
.gallery-grid img.wide {
  grid-column: span 2;
  aspect-ratio: 3 / 2;
}

.gallery-grid img.top {
  object-position: center 25%;
}

.gallery-grid img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   9. LỜI CẢM ƠN (THANKS & FOOTER)
   -------------------------------------------------------------------------- */
.thanks-section {
  background: linear-gradient(170deg, var(--bg-primary) 0%, var(--bg-primary-dark) 100%);
  color: #ffffff;
  padding: 48px 20px;
  text-align: center;
  position: relative;
}

.thanks-section .sec-heading {
  color: var(--gold-light);
  font-size: 2.8rem;
  margin-bottom: 12px;
}

.thanks-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  max-width: 400px;
  margin: 0 auto 24px;
}

.thanks-photo-wrap {
  width: 220px;
  height: 290px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 4px solid #ffffff;
}

.thanks-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.footer {
  padding: 20px;
  background: #1f0308;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer a.credit {
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 500;
}

.footer a.credit:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   MODAL: HỘP QUÀ MỪNG CƯỚI (GIFT BOX MODAL)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  color: var(--text-dark);
  width: 100%;
  max-width: 380px;
  border-radius: var(--radius-md);
  padding: 24px 20px;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-gold);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.gift-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.gift-card-item {
  background: var(--bg-soft-tint);
  border: 1px solid var(--border-tint);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
}

.gift-card-item img.qr {
  width: 170px;
  height: 170px;
  object-fit: contain;
  margin: 0 auto 12px;
  background: #fff;
  padding: 6px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.gift-acc-name {
  font-family: 'Cormorant SC', serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--bg-primary);
}

.gift-acc-bank {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.gift-acc-no {
  font-family: 'Montserrat', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.btn-copy-acc {
  background: var(--bg-primary);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-copy-acc:hover {
  background: var(--bg-primary-dark);
}

/* --------------------------------------------------------------------------
   LIGHTBOX ẢNH
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox img {
  max-width: 92vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  font-size: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* --------------------------------------------------------------------------
   FLOATING MUSIC BUTTON
   -------------------------------------------------------------------------- */
.music-btn {
  position: fixed;
  bottom: 24px;
  right: max(24px, calc(50% - 216px)); /* máy tính: nằm trong khung thiệp 480px */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-primary);
  color: var(--gold-light);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.3s ease;
}

.music-btn.playing {
  animation: spinMusic 4s linear infinite;
}

@keyframes spinMusic {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
