/* Widget demo bar ? file ri?ng, n?p SAU theme.min.css ch? ? trang demo.
   ponytail: m?i selector c? #id ?? th?ng base.css l?n theme; n?u theme d?ng !important
   ??i tr? th? chuy?n widget sang shadow DOM. */
#wedcard-demo-floating-bar {
  --demo-fg: #f8fafc;
  --demo-muted: #94a3b8;
  --demo-accent: #fda4af;
  --demo-cta-bg: linear-gradient(135deg, #f43f5e 0%, #e11d48 50%, #be123c 100%);
  --demo-cta-hover-bg: linear-gradient(135deg, #fb7185 0%, #f43f5e 40%, #e11d48 100%);
  --on-primary: #ffffff;
}
#wedcard-demo-floating-bar,
#wedcard-demo-floating-bar * {
  box-sizing: border-box !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-transform: none !important;
  text-decoration: none !important;
  letter-spacing: normal !important;
}
#wedcard-demo-floating-bar *::before,
#wedcard-demo-floating-bar *::after {
  content: none !important;
  box-shadow: none !important;
}
#wedcard-demo-floating-bar input,
#wedcard-demo-floating-bar input:focus,
#wedcard-demo-floating-bar input:hover {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #fff !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Nút nổi chọn & chuyển đổi mẫu thiệp ở chế độ xem Demo (FAB) */
#wedcard-demo-floating-bar {
  position: fixed;
  bottom: 22px;
  margin-bottom: env(safe-area-inset-bottom, 0px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
  max-width: calc(100vw - 32px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  animation: demoFloatingBarEntry 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s backwards;
}

body.wedcard-body.demo-bar-above-envelope .wedcard-demo-floating-bar {
  z-index: 100001;
}

body.wedcard-body.demo-bar-above-envelope .wedcard-envelope-overlay {
  padding-bottom: 92px;
}

@keyframes demoFloatingBarEntry {
  from {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes demoFloatingBarEntryMobile {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#wedcard-demo-floating-bar .wedcard-demo-switcher {
  position: relative;
  min-width: 240px;
  max-width: 310px;
}

#wedcard-demo-floating-bar .wedcard-demo-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 23, 42, 0.92);
  color: var(--on-primary, #ffffff);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

#wedcard-demo-floating-bar .wedcard-demo-select-trigger:hover {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(255, 255, 255, 0.42);
}

#wedcard-demo-floating-bar .demo-trigger-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

#wedcard-demo-floating-bar .demo-trigger-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

#wedcard-demo-floating-bar .demo-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  color: var(--on-primary, #ffffff);
}

#wedcard-demo-floating-bar .demo-trigger-chevron {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease;
}

#wedcard-demo-floating-bar .wedcard-demo-switcher.is-open .demo-trigger-chevron {
  transform: rotate(180deg);
}

#wedcard-demo-floating-bar .wedcard-demo-popover[hidden] {
  display: none !important;
}

#wedcard-demo-floating-bar .wedcard-demo-popover {
  position: absolute;
  bottom: 100%;
  margin-bottom: 10px;
  left: 0;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: rgba(15, 23, 42, 0.97);
  color: var(--demo-fg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  z-index: 100002;
}

#wedcard-demo-floating-bar .wedcard-demo-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.72);
}

#wedcard-demo-floating-bar .demo-search-icon {
  color: var(--demo-muted);
  flex-shrink: 0;
}

#wedcard-demo-floating-bar .wedcard-demo-search-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--on-primary, #ffffff);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.35;
  outline: none;
}

#wedcard-demo-floating-bar .wedcard-demo-search-input::placeholder {
  color: var(--demo-muted) !important;
}

#wedcard-demo-floating-bar .wedcard-demo-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

#wedcard-demo-floating-bar .wedcard-demo-search-clear[hidden] {
  display: none !important;
}

#wedcard-demo-floating-bar .wedcard-demo-search-clear {
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: var(--demo-fg);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.72rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#wedcard-demo-floating-bar .wedcard-demo-option-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 290px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

#wedcard-demo-floating-bar .wedcard-demo-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  text-align: left;
}

#wedcard-demo-floating-bar .wedcard-demo-option:hover,
#wedcard-demo-floating-bar .wedcard-demo-option:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

#wedcard-demo-floating-bar .wedcard-demo-option.is-active {
  background: rgba(244, 63, 94, 0.24);
  border: 1px solid rgba(251, 113, 133, 0.45);
}

#wedcard-demo-floating-bar .demo-option-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

#wedcard-demo-floating-bar .demo-option-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

#wedcard-demo-floating-bar .demo-option-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--on-primary, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

#wedcard-demo-floating-bar .demo-option-meta {
  font-size: 0.72rem;
  color: var(--demo-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

#wedcard-demo-floating-bar .demo-option-check {
  color: var(--demo-accent);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

#wedcard-demo-floating-bar .wedcard-demo-empty[hidden] {
  display: none !important;
}

#wedcard-demo-floating-bar .wedcard-demo-empty {
  padding: 18px 14px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--demo-muted);
}

#wedcard-demo-floating-bar .wedcard-demo-select-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--demo-cta-bg);
  color: var(--on-primary, #ffffff);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.015em;
  text-decoration: none;
  border-radius: 9999px;
  box-shadow: 0 8px 25px rgba(225, 29, 72, 0.45), 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

#wedcard-demo-floating-bar .wedcard-demo-select-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(225, 29, 72, 0.58), 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  background: var(--demo-cta-hover-bg);
  color: var(--on-primary, #ffffff);
}

#wedcard-demo-floating-bar .wedcard-demo-select-btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
}

#wedcard-demo-floating-bar .wedcard-demo-btn-icon {
  font-size: 1.1rem;
  line-height: 1;
  display: inline-block;
  animation: demoSparkle 2s ease-in-out infinite;
}

@keyframes demoSparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(10deg); }
}

#wedcard-demo-floating-bar .wedcard-demo-btn-text {
  font-weight: 700;
}

#wedcard-demo-floating-bar .wedcard-demo-btn-theme {
  font-weight: 500;
  opacity: 0.92;
  font-size: 0.82rem;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#wedcard-demo-floating-bar .wedcard-demo-btn-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

#wedcard-demo-floating-bar .wedcard-demo-select-btn:hover .wedcard-demo-btn-arrow {
  transform: translateX(3px);
}

@media (max-width: 640px) {
  #wedcard-demo-floating-bar {
    bottom: 12px;
    margin-bottom: env(safe-area-inset-bottom, 0px);
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    transform: none;
    justify-content: flex-start;
    gap: 0;
    animation-name: demoFloatingBarEntryMobile;
  }
  #wedcard-demo-floating-bar .wedcard-demo-switcher {
    flex: 0 0 calc(70% - 4px);
    width: calc(70% - 4px);
    min-width: 0;
    max-width: none;
    margin-right: 8px;
  }
  #wedcard-demo-floating-bar .wedcard-demo-select-trigger {
    padding: 10px 10px;
    font-size: 0.8rem;
    gap: 6px;
  }
  #wedcard-demo-floating-bar .wedcard-demo-select-btn {
    flex: 0 0 calc(30% - 4px);
    width: calc(30% - 4px);
    padding: 10px 4px;
    font-size: 0.72rem;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
  }
  #wedcard-demo-floating-bar .wedcard-demo-btn-icon {
    font-size: 0.78rem;
  }
  #wedcard-demo-floating-bar .wedcard-demo-btn-theme,
  #wedcard-demo-floating-bar .wedcard-demo-btn-arrow {
    display: none;
  }
  #wedcard-demo-floating-bar .wedcard-demo-popover {
    left: 0;
    right: auto;
    width: calc(100vw - 20px);
    max-width: none;
  }
  #wedcard-demo-floating-bar .wedcard-demo-option-list {
    max-height: 48vh;
  }
  body.wedcard-body.has-demo-bar .wedcard-music-player {
    bottom: 68px;
    margin-bottom: env(safe-area-inset-bottom, 0px);
    left: 12px;
  }
  body.wedcard-body.has-demo-bar .wedcard-hearts-toggle {
    bottom: 68px;
    margin-bottom: env(safe-area-inset-bottom, 0px);
    right: 12px;
  }
  body.wedcard-body.has-demo-bar .wedcard-scroll-top {
    bottom: 118px;
    margin-bottom: env(safe-area-inset-bottom, 0px);
    right: 12px;
  }
  body.wedcard-body.has-demo-bar .wedcard-fab-export {
    bottom: 168px;
    margin-bottom: env(safe-area-inset-bottom, 0px);
    right: 12px;
  }
  body.wedcard-body.demo-bar-above-envelope .wedcard-envelope-overlay {
    padding: 12px 12px 84px;
  }
  body.wedcard-body.demo-bar-above-envelope .envelope-book-card {
    min-height: 465px;
  }
}

@media (max-width: 374px) {
  #wedcard-demo-floating-bar .wedcard-demo-select-btn {
    padding: 10px 3px;
    font-size: 0.66rem;
    gap: 2px;
  }
  #wedcard-demo-floating-bar .wedcard-demo-btn-icon {
    font-size: 0.72rem;
  }
}