#cedric-presence-root {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  max-width: 320px;
  font-family: var(--wd-primary-font, 'Inter', sans-serif);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 240ms ease, transform 240ms ease;
}

body.cedric-presence-ready #cedric-presence-root {
  opacity: 1;
  transform: translateY(0);
}

.cedric-product-bubble {
  margin-top: 1rem;
  position: relative;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.cedric-product-bubble__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: none;
  background: #0b1f3a;
  color: #fff;
  cursor: pointer;
}

.cedric-product-bubble__avatar {
  font-size: 1.5rem;
}

.cedric-product-bubble__content {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(11, 31, 58, 0.9);
  color: #fff;
  box-shadow: 0 18px 35px rgba(11, 31, 58, 0.2);
}

body.cedric-presence-ready .cedric-product-bubble,
.cedric-product-bubble.is-loaded {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cedric-product-bubble.is-refreshing {
  box-shadow: 0 22px 40px rgba(11, 31, 58, 0.28);
}

.cedric-product-bubble.is-error {
  box-shadow: 0 22px 40px rgba(224, 82, 99, 0.35);
}

#cedric-gift-tray {
  margin-top: 2rem;
  padding: 1rem;
  border-radius: 1rem;
  background: #f5f7fb;
  box-shadow: inset 0 0 0 1px rgba(11, 31, 58, 0.1);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

body.cedric-presence-ready #cedric-gift-tray:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

#cedric-gift-tray.is-refreshing {
  box-shadow: inset 0 0 0 1px rgba(11, 31, 58, 0.2);
}

#cedric-gift-tray.is-stale {
  box-shadow: inset 0 0 0 1px rgba(248, 196, 113, 0.45);
}

#cedric-gift-tray.is-error {
  box-shadow: inset 0 0 0 1px rgba(224, 82, 99, 0.45);
}

.cedric-cache-status {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  color: rgba(255, 255, 255, 0.85);
}

.cedric-cache-status[data-state='refreshing'] {
  color: rgba(255, 255, 255, 0.95);
}

.cedric-cache-status[data-state='stale'] {
  color: #ffe08a;
}

.cedric-cache-status[data-state='error'] {
  color: #ffd6d9;
}

#cedric-gift-tray .cedric-cache-status {
  color: #425b7a;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

#cedric-gift-tray .cedric-cache-status[data-state='refreshing'] {
  color: #2e5aac;
}

#cedric-gift-tray .cedric-cache-status[data-state='error'] {
  color: #d9534f;
}

@keyframes cedric-pulse-status {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}

.cedric-product-bubble.is-refreshing .cedric-cache-status,
#cedric-gift-tray.is-refreshing .cedric-cache-status {
  animation: cedric-pulse-status 1.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  #cedric-presence-root,
  .cedric-product-bubble,
  #cedric-gift-tray {
    transition: none;
  }

  .cedric-product-bubble.is-refreshing .cedric-cache-status,
  #cedric-gift-tray.is-refreshing .cedric-cache-status {
    animation: none;
  }
}

.cedric-age-gate {
  position: fixed;
  inset: 0;
  background: rgba(9, 18, 30, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.cedric-age-gate__dialog {
  background: #fff;
  padding: 2rem;
  border-radius: 0.75rem;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.cedric-age-gate__rating {
  font-weight: 600;
  margin: 0.75rem 0 1.5rem;
}

.cedric-age-gate__dialog button {
  margin: 0.5rem;
}

.cedric-playroom__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #0b1f3a, #2e5aac);
  color: #fff;
  cursor: pointer;
}

.cedric-playroom__toggle:focus {
  outline: 3px solid rgba(46, 90, 172, 0.3);
  outline-offset: 3px;
}

.cedric-chat-trigger {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
}

.cedric-chat-trigger__button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: none;
  background: #0b1f3a;
  color: #fff;
  cursor: pointer;
}

.cedric-chat-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 33, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.cedric-chat-modal[hidden] {
  display: none !important;
}

.cedric-chat-modal__surface {
  background: #fff;
  width: min(90vw, 480px);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(8, 18, 33, 0.2);
  display: flex;
  flex-direction: column;
}

.cedric-chat-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #0b1f3a;
  color: #fff;
}

.cedric-chat-modal__body {
  padding: 0;
  background: #f5f8ff;
  min-height: 320px;
}

.cedric-chat-modal__body iframe {
  width: 100%;
  border: none;
  height: 420px;
}

.cedric-playroom__panel {
  background: #fff;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 18px 40px rgba(11, 31, 58, 0.08);
  max-width: 360px;
  margin: 1rem auto;
}
