/* ==============================================================================
   BẢNG MÀU: ĐỎ VANG (#722F37), VÀNG ĐẤT/HOÀNG THỔ (#D4A373, #E07A5F), XANH LÁ ẤM (#2D6A4F)
   PHONG CÁCH: ẤM CÚNG, TƯƠI SÁNG, TRANG NHÃ, HIỆN ĐẠI
   ============================================================================== */

:root {
  --primary-wine: #7E1E28;         /* Đỏ vang đậm sang trọng */
  --primary-wine-light: #9B2835;
  --secondary-earth: #C67D5A;      /* Đất nung / hoàng thổ ấm áp */
  --secondary-gold: #DDA15E;       /* Vàng kim ấm cúng */
  --accent-green: #386641;         /* Xanh lá cây tươi tốt / tài lộc */
  --accent-green-light: #6A994E;
  
  --bg-cream: #FDFBF7;             /* Kem ấm làm nền dịu mắt */
  --bg-card: #FFFFFF;
  --bg-card-alt: #F7EFE5;
  
  --text-main: #33272A;
  --text-muted: #6B5B52;
  --border-color: #EADBC8;
  
  --shadow-sm: 0 4px 12px rgba(114, 47, 55, 0.06);
  --shadow-md: 0 8px 24px rgba(114, 47, 55, 0.1);
  --shadow-lg: 0 16px 36px rgba(114, 47, 55, 0.14);
  
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: var(--font-sans);
  background-color: var(--bg-cream);
  color: var(--text-main);
  line-height: 1.6;
  /* Chặn native scroll — JS sẽ quản lý cuộn */
  overflow: hidden;
  height: 100%;
  width: 100%;
}

/* HOA VĂN NỀN TÂN GIA */
.bg-decor-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 380px;
  background: radial-gradient(circle at 50% -20%, rgba(126, 30, 40, 0.12) 0%, rgba(221, 161, 94, 0.08) 50%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* ==============================================================================
   SECTIONS WRAPPER — CONTAINER CUỘN DỌC ẨN SCROLLBAR
   ============================================================================== */
#sectionsWrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: scroll;
  /* Ẩn scrollbar trên tất cả trình duyệt */
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Cho phép scroll-snap nếu cần */
  scroll-behavior: smooth;
  z-index: 1;
}

#sectionsWrapper::-webkit-scrollbar {
  display: none;
}

/* ==============================================================================
   SECTION PANEL — MỖI SECTION CHIẾM 1 MÀN HÌNH
   ============================================================================== */
.section-panel {
  /* Chiều cao chính xác bằng màn hình (dvh hỗ trợ mobile browser bar) */
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Nội dung bên trong section — có thể cuộn nếu dài hơn màn hình */
.section-inner {
  width: 100%;
  max-width: 560px;
  max-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 20px 80px;
  margin: 0 auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Đảm bảo section-inner không block các touch event của wrapper */
  position: relative;
  z-index: 2;
}

.section-inner::-webkit-scrollbar {
  display: none;
}

/* ==============================================================================
   DOT NAVIGATOR — 4 chấm cố định bên phải màn hình
   ============================================================================== */
#dotNav {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  background: transparent;
  border: none;
  padding: 8px 4px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(126, 30, 40, 0.22);
  border: none;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  outline: none;
  display: block;
}

.dot:hover {
  background: rgba(126, 30, 40, 0.5);
  transform: scale(1.3);
}

.dot.active {
  background: var(--primary-wine);
  width: 10px;
  height: 24px;
  border-radius: 5px;
  transform: none;
}

/* ==============================================================================
   NÚT NỔI MŨI TÊN XUỐNG (FLOATING ARROW)
   ============================================================================== */
.floating-arrow-btn {
  position: fixed;
  bottom: 28px;
  right: 44px;     /* đủ khoảng cách với dotNav */
  z-index: 100;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-wine) 0%, var(--secondary-earth) 100%);
  color: white;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(126, 30, 40, 0.35);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-arrow-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(126, 30, 40, 0.45);
}

.floating-arrow-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.arrow-icon {
  font-size: 22px;
  display: inline-block;
  animation: bounceArrow 1.6s infinite ease-in-out;
}

@keyframes bounceArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ==============================================================================
   GỢI Ý CUỘN Ở SECTION 1
   ============================================================================== */
.scroll-hint {
  text-align: center;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0.75;
  animation: fadeInHint 2s ease 1s both;
}

.scroll-hint-arrow {
  font-size: 22px;
  animation: bounceArrow 1.6s infinite ease-in-out;
  color: var(--secondary-earth);
  margin-top: 4px;
}

@keyframes fadeInHint {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 0.75; transform: translateY(0); }
}

/* ==============================================================================
   THẺ THƯ MỜI CHÍNH
   ============================================================================== */
.invitation-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  margin-bottom: 0;
}

.invitation-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--primary-wine), var(--secondary-earth), var(--secondary-gold), var(--accent-green));
}

/* HEADER THƯ MỜI */
.invite-header {
  text-align: center;
  padding: 40px 24px 20px;
  background: linear-gradient(180deg, rgba(247, 239, 229, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
}

.house-icon-wrapper {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--primary-wine) 0%, var(--secondary-earth) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  color: white;
  font-size: 32px;
}

.invite-subtitle {
  color: var(--secondary-earth);
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.invite-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--primary-wine);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}

.host-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 18px auto;
  width: 70%;
  color: var(--secondary-gold);
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* LỜI MỜI & NỘI DUNG */
.invite-body {
  padding: 6px 28px 28px;
  text-align: center;
}

.invite-message {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 24px;
  line-height: 1.8;
}

/* GRID THỜI GIAN VÀ ĐỊA ĐIỂM */
.event-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 10px;
}

.info-item {
  background: var(--bg-card-alt);
  padding: 18px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(221, 161, 94, 0.3);
  text-align: center;
  transition: transform 0.2s ease;
}

.info-item:hover {
  transform: translateY(-2px);
}

.info-icon {
  font-size: 22px;
  margin-bottom: 6px;
  display: inline-block;
}

.info-label {
  font-size: 0.8rem;
  color: var(--secondary-earth);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 4px;
}

.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 14px;
  background-color: var(--accent-green);
  color: white;
  text-decoration: none;
  font-size: 0.82rem;
  border-radius: 20px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.map-btn:hover {
  background-color: var(--accent-green-light);
}

/* ==============================================================================
   SECTION 1: ĐỊNH DANH KHÁCH MỜI (DROPDOWN + SESSION LOCK)
   ============================================================================== */
.guest-selector-wrapper {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.guest-select {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  background: white;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.guest-select:focus {
  border-color: var(--primary-wine);
}

.btn-identify {
  padding: 12px 24px;
  background: var(--primary-wine);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

.btn-identify:hover {
  background: var(--primary-wine-light);
  transform: translateY(-1px);
}

.identified-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(56, 102, 65, 0.1);
  border: 1px solid var(--accent-green);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  color: var(--accent-green);
}

.identified-badge strong {
  color: var(--accent-green);
  font-size: 1.05rem;
}

.btn-reset-session {
  background: none;
  border: none;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
}

.btn-reset-session:hover {
  color: var(--primary-wine);
}

/* ==============================================================================
   PHẦN 2: XÁC NHẬN THAM DỰ (RSVP)
   ============================================================================== */
.rsvp-section {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.rsvp-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-green), var(--secondary-gold));
}

.rsvp-header {
  text-align: center;
  margin-bottom: 20px;
}

.rsvp-header h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--primary-wine);
  margin-bottom: 6px;
}

.rsvp-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.rsvp-form-container {
  max-width: 100%;
}

.rsvp-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.rsvp-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #FAFAFA;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: all 0.25s ease;
  font-family: inherit;
}

.rsvp-option-btn .icon {
  font-size: 26px;
}

.rsvp-option-btn:hover {
  border-color: var(--secondary-gold);
  background: white;
}

.rsvp-option-btn.selected.yes {
  border-color: var(--accent-green);
  background: rgba(56, 102, 65, 0.08);
  color: var(--accent-green);
}

.rsvp-option-btn.selected.no {
  border-color: var(--primary-wine);
  background: rgba(126, 30, 40, 0.06);
  color: var(--primary-wine);
}

.rsvp-details-box {
  background: var(--bg-card-alt);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(221, 161, 94, 0.3);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: white;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-wine);
}

.btn-submit-rsvp {
  width: 100%;
  padding: 12px;
  background: var(--accent-green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.btn-submit-rsvp:hover {
  background: var(--accent-green-light);
}

.rsvp-confirmed-badge {
  background: var(--bg-card-alt);
  border: 1.5px solid var(--accent-green);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
}

.rsvp-confirmed-badge.cannot-attend {
  border-color: var(--secondary-earth);
}

/* ==============================================================================
   PHẦN 3: GIFT REGISTRY (DANH SÁCH QUÀ TẶNG)
   ============================================================================== */
.gift-section {
  width: 100%;
}

.section-header {
  text-align: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--primary-wine);
  margin-bottom: 6px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.gift-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.gift-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary-gold);
}

.gift-card.claimed {
  opacity: 0.55;
  background: #FAFAFA;
  border-style: dashed;
}

.gift-tag {
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 12px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.tag-available {
  background: rgba(56, 102, 65, 0.12);
  color: var(--accent-green);
}

.tag-claimed {
  background: rgba(107, 91, 82, 0.12);
  color: var(--text-muted);
}

.gift-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 14px;
}

.gift-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.btn-link-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--secondary-earth);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-link-preview:hover {
  background: var(--bg-card-alt);
  color: var(--primary-wine);
}

.btn-claim {
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary-wine) 0%, var(--secondary-earth) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.btn-claim:hover {
  opacity: 0.95;
  box-shadow: 0 4px 12px rgba(126, 30, 40, 0.25);
}

.btn-claim:disabled {
  background: #CCC;
  cursor: not-allowed;
  box-shadow: none;
}

/* Nút bỏ qua quà */
.btn-skip-gifts {
  background: none;
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-skip-gifts:hover {
  border-color: var(--secondary-gold);
  color: var(--primary-wine);
}

/* ==============================================================================
   PHẦN 4: LỜI CẢM ƠN (THANK YOU SECTION)
   ============================================================================== */
.thank-you-section {
  background: linear-gradient(135deg, rgba(126, 30, 40, 0.08) 0%, rgba(221, 161, 94, 0.12) 100%);
  border: 1px dashed var(--secondary-gold);
  border-radius: var(--radius-lg);
  padding: 44px 28px;
  text-align: center;
}

.thank-you-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.thank-you-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--primary-wine);
  margin-bottom: 14px;
}

.thank-you-text {
  max-width: 480px;
  margin: 0 auto 20px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.host-signature {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--secondary-earth);
  font-style: italic;
  font-weight: 700;
  margin-bottom: 20px;
}

.thank-you-footer {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ==============================================================================
   MODAL XÁC NHẬN CHỌN QUÀ
   ============================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(51, 39, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 30px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  text-align: center;
  margin-bottom: 18px;
}

.modal-gift-icon {
  font-size: 38px;
  margin-bottom: 8px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--primary-wine);
}

.modal-body {
  margin-bottom: 22px;
}

.modal-gift-target {
  background: var(--bg-card-alt);
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-weight: 600;
  color: var(--primary-wine);
  border-left: 4px solid var(--primary-wine);
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-cancel {
  padding: 10px 20px;
  background: #EEE;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  font-family: inherit;
}

.btn-confirm {
  padding: 10px 24px;
  background: var(--accent-green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
  font-family: inherit;
}

.btn-confirm:hover {
  background: var(--accent-green-light);
}

/* THÔNG BÁO TOAST */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 68px;   /* cách floating arrow button */
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: #33272A;
  color: white;
  font-size: 0.92rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
  max-width: 320px;
}

.toast.success {
  background: var(--accent-green);
}

.toast.error {
  background: var(--primary-wine);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==============================================================================
   SECTION HÌNH ẢNH NGÔI NHÀ (TỔ ẤM MỚI) - CAROUSEL VUỐT NGANG
   ============================================================================== */
.gallery-section {
  width: 100%;
}

.gallery-header {
  margin-bottom: 16px;
}

.gallery-header-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 6px;
}

.gallery-carousel-wrapper {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  padding: 16px;
  overflow: hidden;
}

.gallery-carousel-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--secondary-gold), var(--primary-wine), var(--secondary-earth));
  z-index: 5;
}

/* Khung trượt vuốt ngang */
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 16px;
  border-radius: var(--radius-md);
  padding-bottom: 2px;
  touch-action: pan-x pan-y;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

/* Từng slide */
.gallery-slide {
  flex: 0 0 100%;
  max-width: 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Khung ảnh */
.gallery-image-box {
  position: relative;
  width: 100%;
  height: 230px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #201A18;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.gallery-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-image-box:hover img {
  transform: scale(1.03);
}

/* Badge số thứ tự ảnh góc trên */
.gallery-slide-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #FFF;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Khung chú thích của chủ nhà bên dưới ảnh */
.gallery-caption-box {
  background: var(--bg-card-alt);
  border: 1px solid rgba(221, 161, 94, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 12px;
  position: relative;
  text-align: left;
}

.gallery-caption-box::before {
  content: "“";
  position: absolute;
  top: 4px;
  left: 8px;
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--secondary-gold);
  opacity: 0.45;
  line-height: 1;
}

.gallery-caption-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--primary-wine);
  margin-bottom: 6px;
  padding-left: 18px;
}

.gallery-caption-text {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.55;
  padding-left: 18px;
  font-style: italic;
}

.gallery-caption-host {
  margin-top: 8px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary-earth);
  letter-spacing: 0.3px;
}

/* Nút bấm Prev / Next */
.gallery-nav-btn {
  position: absolute;
  top: 130px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-wine);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 10;
  outline: none;
}

.gallery-nav-btn:hover {
  background: var(--primary-wine);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn.prev {
  left: 8px;
}

.gallery-nav-btn.next {
  right: 8px;
}

.gallery-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Bottom controls: Dots & Counter */
.gallery-controls-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 4px;
}

.gallery-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(126, 30, 40, 0.25);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 0;
}

.gallery-dot.active {
  background: var(--primary-wine);
  width: 22px;
  border-radius: 4px;
}

.gallery-counter {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Swipe Hint */
.gallery-swipe-hint {
  text-align: center;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--secondary-earth);
  letter-spacing: 0.3px;
  opacity: 0.9;
}

/* ==============================================================================
   RESPONSIVE — MOBILE OPTIMIZED
   ============================================================================== */
@media (max-width: 600px) {
  .section-inner {
    padding: 16px 16px 90px;
  }

  .invite-header {
    padding: 28px 18px 16px;
  }

  .invite-title {
    font-size: 1.9rem;
  }

  .invite-body {
    padding: 4px 16px 20px;
  }

  .invite-message {
    font-size: 0.95rem;
    margin-bottom: 16px;
  }

  .event-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .rsvp-section {
    padding: 22px 16px;
  }

  .rsvp-header h2 {
    font-size: 1.5rem;
  }

  .guest-selector-wrapper {
    flex-direction: column;
  }

  .btn-identify {
    justify-content: center;
  }

  .gift-grid {
    grid-template-columns: 1fr;
  }

  .thank-you-section {
    padding: 36px 20px;
  }

  .thank-you-title {
    font-size: 1.7rem;
  }

  /* Đẩy dotNav vào sát mép */
  #dotNav {
    right: 10px;
  }

  .floating-arrow-btn {
    right: 12px;
    bottom: 80px;
    width: 44px;
    height: 44px;
  }

  .toast-container {
    right: 16px;
    bottom: 140px;
  }

  .toast {
    font-size: 0.85rem;
    max-width: calc(100vw - 32px);
  }

  /* GALLERY SECTION MOBILE */
  .gallery-carousel-wrapper {
    padding: 12px;
  }

  .gallery-image-box {
    height: 195px;
  }

  .gallery-caption-box {
    padding: 12px 14px;
    margin-top: 10px;
  }

  .gallery-caption-title {
    font-size: 1rem;
  }

  .gallery-caption-text {
    font-size: 0.86rem;
  }

  .gallery-nav-btn {
    top: 110px;
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .gallery-nav-btn.prev {
    left: 4px;
  }

  .gallery-nav-btn.next {
    right: 4px;
  }
}

@media (max-width: 360px) {
  .invite-title {
    font-size: 1.65rem;
  }

  .rsvp-options-grid {
    grid-template-columns: 1fr;
  }

  .gallery-image-box {
    height: 165px;
  }
}
