/* ===================================================================
   VOUCHER ACQUISITION — VIP GIFT TICKET, FLYOUT ANIMATION & HERO DISCOUNT
   =================================================================== */

/* Khóa cuộn và ẩn triệt để thanh cuộn (scrollbar) khi modal voucher mở */
html:has(dialog.voucher-acquisition[open]),
body:has(dialog.voucher-acquisition[open]),
html.voucher-modal-open,
body.voucher-modal-open {
  overflow: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html:has(dialog.voucher-acquisition[open])::-webkit-scrollbar,
body:has(dialog.voucher-acquisition[open])::-webkit-scrollbar,
html.voucher-modal-open::-webkit-scrollbar,
body.voucher-modal-open::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Canvas pháo hoa phủ toàn màn hình */
.voucher-confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10001;
}

/* Modal Dialog chính - Ẩn hoàn toàn scrollbar */
.voucher-acquisition {
  margin: auto;
  width: min(410px, calc(100% - 20px));
  max-height: calc(100dvh - 20px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: #0f172a;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-shadow: none;
}

.voucher-acquisition::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.voucher-acquisition::backdrop {
  background: rgba(7, 27, 55, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ===================================================================
   GIAI ĐOẠN 1: HỘP QUÀ 3D NỔI LÊN (GIFT BOX INTRO)
   =================================================================== */
.voucher-gift-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 24px;
  z-index: 20;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.voucher-gift-intro.is-hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

/* Hào quang vàng xoay tròn tỏa sáng */
.gift-radial-rays {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.55) 0%, rgba(242, 111, 33, 0.25) 50%, transparent 70%);
  animation: giftRayRotate 8s linear infinite, giftRayPulse 2s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes giftRayPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 1; }
}

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

/* Hộp quà 3D to đẹp nổi bật */
.gift-box-3d {
  position: relative;
  width: 96px;
  height: 90px;
  cursor: pointer;
  transform-style: preserve-3d;
  animation: giftBoxFloat 2s infinite ease-in-out;
  transition: transform 0.3s ease;
}

.gift-box-3d:hover {
  transform: scale(1.08) translateY(-4px);
}

@keyframes giftBoxFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(-4deg); }
  75% { transform: translateY(-8px) rotate(4deg); }
}

/* Nắp hộp quà */
.gift-lid-group {
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 26px;
  z-index: 5;
  transform-origin: left bottom;
  transition: all 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gift-lid-cap {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(135deg, #f26f21, #dc2626);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Nơ vàng kim 3D hoàng gia */
.gift-bow {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 22px;
}

.bow-loop {
  position: absolute;
  top: 0;
  width: 22px;
  height: 16px;
  border: 3px solid #fbbf24;
  border-radius: 50% 50% 0 50%;
  background: linear-gradient(135deg, #fef08a, #f59e0b);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.bow-left { left: 4px; transform: rotate(-25deg); }
.bow-right { right: 4px; transform: scaleX(-1) rotate(-25deg); }

.bow-knot {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

/* Dải ruy băng rủ */
.bow-ribbon {
  position: absolute;
  top: 14px;
  width: 6px;
  height: 12px;
  background: #f59e0b;
  border-radius: 2px;
}
.ribbon-left { left: 16px; transform: rotate(15deg); }
.ribbon-right { right: 16px; transform: rotate(-15deg); }

/* Thân hộp quà */
.gift-box-body {
  position: absolute;
  bottom: 0;
  left: 6px;
  width: 84px;
  height: 66px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(135deg, #ea580c, #b91c1c);
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.4);
  overflow: hidden;
}

/* Ruy băng chữ thập */
.gift-ribbon-v {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 100%;
  background: linear-gradient(180deg, #fde047, #f59e0b);
}

.gift-ribbon-h {
  position: absolute;
  top: 45%;
  left: 0;
  width: 100%;
  height: 14px;
  background: linear-gradient(90deg, #fde047, #f59e0b);
}

/* Luồng sáng vàng lóe lên từ miệng hộp */
.gift-glow-burst {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #fde047 60%, transparent 80%);
  opacity: 0;
  transition: all 0.5s ease;
  pointer-events: none;
}

.gift-intro-hint {
  font-size: 13px;
  font-weight: 800;
  color: #fef08a;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  margin: 18px 0 0;
  letter-spacing: 0.4px;
  animation: hintBlink 1.2s infinite alternate;
}

@keyframes hintBlink {
  from { opacity: 0.7; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.02); }
}

/* Khi hộp quà MỞ NẮP */
.voucher-gift-intro.is-opening .gift-box-3d {
  animation: none;
}

.voucher-gift-intro.is-opening .gift-lid-group {
  transform: translateY(-55px) rotate(-35deg) scale(0.85);
  opacity: 0;
}

.voucher-gift-intro.is-opening .gift-glow-burst {
  opacity: 1;
  transform: translateX(-50%) scale(3.5);
}

/* ===================================================================
   GIAI ĐOẠN 2: TẤM VÉ VOUCHER BAY RA PHÓNG TO (FLYOUT ANIMATION)
   =================================================================== */
.voucher-acquisition-panel {
  position: relative;
  padding: 16px 16px 12px;
  text-align: center;
  background: linear-gradient(145deg, #ffffff 0%, #fffbf6 50%, #fff7ed 100%);
  border: 2px solid #f97316;
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(242, 111, 33, 0.4), 0 0 35px rgba(245, 158, 11, 0.2);
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

.voucher-acquisition-panel::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Ban đầu tấm vé thu nhỏ chờ hộp quà mở */
.voucher-acquisition-panel.is-waiting {
  opacity: 0;
  transform: scale(0.1) translateY(80px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  padding: 0;
  border: none;
}

/* Khi bay ra phóng to lộng lẫy */
.voucher-acquisition-panel.is-revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  max-height: unset;
  animation: ticketPopOut 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ticketPopOut {
  0% { opacity: 0; transform: scale(0.15) translateY(120px) rotate(-8deg); }
  70% { opacity: 1; transform: scale(1.04) translateY(-6px) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) translateY(0) rotate(0deg); }
}

/* 2 Rãnh khoét bán nguyệt (Notches) phong cách vé voucher quà tặng */
.ticket-notch {
  position: absolute;
  top: 138px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #071b37;
  z-index: 10;
  pointer-events: none;
}

.ticket-notch-left {
  left: -9px;
  box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.25);
  border-right: 2px solid #f97316;
}

.ticket-notch-right {
  right: -9px;
  box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.25);
  border-left: 2px solid #f97316;
}

/* Nút đóng X tinh tế - đặt gọn góc trên không che chữ */
.voucher-acquisition-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #64748b;
  cursor: pointer;
  z-index: 25;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.voucher-acquisition-close:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: rotate(90deg) scale(1.1);
}

.voucher-ticket-head {
  padding: 0;
}

.voucher-acquisition-eyebrow {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #f26f21, #ea580c);
  padding: 2px 10px;
  border-radius: 12px;
  margin: 0 0 4px;
  box-shadow: 0 2px 6px rgba(242, 111, 33, 0.2);
}

.voucher-acquisition h2 {
  font-size: 18px;
  line-height: 1.25;
  margin: 0 0 3px;
  color: #0f294c;
  font-weight: 800;
  text-wrap: balance;
}

.voucher-acquisition-label {
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 700;
  color: #c2410c;
  background: #fff8ef;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 3px 10px;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

/* ===================================================================
   KHỐI SỐ TIỀN ƯU ĐÃI TO NỔI BẬT (HERO DISCOUNT BANNER)
   =================================================================== */
.voucher-hero-discount {
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 50%, #fed7aa 100%);
  border: 1.5px dashed #f59e0b;
  border-radius: 12px;
  padding: 6px 10px;
  margin: 6px 0;
  text-align: center;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.12);
  animation: heroPulse 2.5s infinite alternate ease-in-out;
}

@keyframes heroPulse {
  0% { border-color: #f59e0b; box-shadow: 0 3px 10px rgba(245, 158, 11, 0.12); }
  100% { border-color: #f26f21; box-shadow: 0 4px 14px rgba(242, 111, 33, 0.2); }
}

.hero-discount-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 2px;
}

.hero-discount-sparkle {
  font-size: 12px;
  animation: sparkleRotate 2s infinite linear;
}

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

.hero-discount-prefix {
  font-size: 10.5px;
  font-weight: 800;
  color: #b45309;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* CON SỐ TIỀN TO NỔI BẬT NHƯNG GỌN */
.hero-discount-amount-wrap {
  margin: 0;
}

.hero-discount-amount {
  display: inline-block;
  font-size: clamp(24px, 6.5vw, 30px);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #f26f21 0%, #ea580c 50%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 3px rgba(234, 88, 12, 0.25));
  letter-spacing: -0.3px;
}

.hero-discount-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: #78350f;
  margin: 2px 0 0;
  line-height: 1.3;
}

/* Đường nét đứt chia cuống vé */
.ticket-perforated-line {
  position: relative;
  margin: 6px -16px;
  border-top: 1.5px dashed #fed7aa;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ticket-cut-icon {
  position: absolute;
  top: -8px;
  background: #fff;
  padding: 0 6px;
  font-size: 11px;
  color: #ea580c;
}

/* Danh sách quyền lợi chi tiết */
.voucher-acquisition-benefits {
  display: grid;
  gap: 4px;
  text-align: left;
  margin-bottom: 6px;
}

.voucher-acquisition-benefits p {
  margin: 0;
  padding: 4px 8px;
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-left: 3px solid #f26f21;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.35;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  overflow-wrap: anywhere;
}

/* Thẻ Coupon Box VIP */
.voucher-acquisition-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  border: 1.5px dashed #f59e0b;
  border-radius: 10px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  margin: 6px 0;
}

.ticket-field-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.ticket-code-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.voucher-acquisition-ticket strong {
  font-size: 14px;
  color: #ea580c;
  font-family: var(--font-family-mono, monospace);
  letter-spacing: 0.5px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.btn-copy-code {
  padding: 2px 6px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid #fbd38d;
  background: #ffffff;
  color: #b45309;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-copy-code:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}

.ticket-date-zone {
  border-left: 1px solid #fed7aa;
  padding-left: 8px;
  text-align: right;
  flex-shrink: 0;
}

.ticket-date-zone strong {
  font-size: 11.5px;
  color: #475569;
}

/* Điều kiện áp dụng */
.voucher-acquisition-conditions {
  text-align: left;
  font-size: 11px;
  color: #64748b;
  margin: 0 0 6px;
}

.voucher-acquisition-conditions summary {
  min-height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-weight: 700;
  color: #64748b;
  font-size: 11px;
}

.voucher-acquisition-conditions p {
  white-space: pre-line;
  line-height: 1.45;
  margin: 2px 0 6px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

/* ===================================================================
   NÚT HÀNH ĐỘNG CTA QUÉT SÁNG
   =================================================================== */
.voucher-acquisition-use {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 8px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(110deg, #f26f21 0%, #ea580c 45%, #ff8b26 55%, #ea580c 100%);
  background-size: 200% auto;
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(242, 111, 33, 0.35);
  transition: all 0.25s ease;
  animation: btnShimmer 3s infinite linear;
  overflow: hidden;
}

@keyframes btnShimmer {
  to { background-position: 200% center; }
}

.voucher-acquisition-use:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 8px 22px rgba(242, 111, 33, 0.45);
}

.voucher-acquisition-use:active {
  transform: scale(0.98);
}

.use-arrow-icon {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.voucher-acquisition-use:hover .use-arrow-icon {
  transform: translateX(3px);
}

.voucher-acquisition-reassurance {
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
  margin: 4px 0 2px;
}

.voucher-acquisition-later {
  min-height: 28px;
  background: none;
  border: 0;
  color: #94a3b8;
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s ease;
  padding: 2px 6px;
}
.voucher-acquisition-later:hover {
  color: #475569;
}

/* Nút nhắc nhở nổi (Floating Reminder) */
/* Nút nhắc nhở nổi (Floating Reminder) - z-index 90 để không bao giờ đè lên Bottom Sheet (200) */
.voucher-acquisition-reminder {
  position: fixed;
  right: 14px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  min-height: 40px;
  padding: 6px 14px;
  border: 2px solid #f97316;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff7ed, #fff);
  color: #ea580c;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 6px 20px rgba(242, 111, 33, 0.3);
  cursor: pointer;
  animation: reminderFloat 2.5s infinite ease-in-out;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Ẩn hoàn toàn nút nhắc nhở khi có Bottom Sheet hoặc Dialog mở */
html:has(.bottom-sheet-backdrop.active) .voucher-acquisition-reminder,
body:has(.bottom-sheet-backdrop.active) .voucher-acquisition-reminder,
html:has(dialog[open]) .voucher-acquisition-reminder,
body:has(dialog[open]) .voucher-acquisition-reminder,
.bottom-sheet-backdrop.active ~ .voucher-acquisition-reminder,
.bottom-sheet-backdrop.active ~ * .voucher-acquisition-reminder {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ===================================================================
   KHỐI BANNER ƯU ĐÃI NỔI BẬT TRONG FORM TƯ VẤN (FORM VOUCHER SUMMARY)
   =================================================================== */
.form-voucher-summary {
  position: relative;
  display: block;
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 50%, #fed7aa 100%);
  border: 1.5px solid #f97316;
  border-left: 5px solid #ea580c;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(242, 111, 33, 0.15);
  animation: summaryFadeIn 0.3s ease-out;
}

.form-voucher-summary[hidden] {
  display: none !important;
}

@keyframes summaryFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reminderFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.voucher-acquisition-reminder[hidden] {
  display: none !important;
}

.reminder-gift-icon {
  font-size: 16px;
}

.voucher-acquisition :focus-visible,
.voucher-acquisition-reminder:focus-visible {
  outline: 3px solid #f26f21;
  outline-offset: 2px;
}

@media (max-width: 380px) {
  .voucher-acquisition-panel {
    padding: 20px 16px 16px;
  }
  .voucher-hero-discount {
    padding: 12px 10px;
  }
  .hero-discount-amount {
    font-size: 30px;
  }
  .voucher-acquisition-ticket {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ticket-date-zone {
    border-left: none;
    border-top: 1px solid #fed7aa;
    padding-left: 0;
    padding-top: 6px;
  }
}
