/*
  Mascot contact component
  - Places mascot as if standing on the browser edge
  - Keeps idle speech bubble above the head, not overlapping the body
  - Social icons fan out upward from the head/bubble area
*/
.floating-mascot {
  --mascot-size: clamp(132px, 8.2vw, 176px);
  --bubble-offset-y: calc(var(--mascot-size) * -0.38);
  --social-offset-y: calc(var(--mascot-size) * -0.48);
  right: max(10px, env(safe-area-inset-right));
  bottom: max(-8px, env(safe-area-inset-bottom));
  width: calc(var(--mascot-size) * 1.26);
  min-height: calc(var(--mascot-size) * 2.12);
  padding: 0 0 4px;
  transform-origin: 62% 100%;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.42));
}

.floating-mascot::before {
  inset: 12% 0 0 22%;
  border-radius: 42% 44% 18% 18%;
  filter: blur(16px);
}

.mascot-stage {
  min-height: calc(var(--mascot-size) * 2.12);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.mascot-visual {
  width: var(--mascot-size);
  max-width: none;
  margin-left: auto;
  margin-right: 0;
  transform-origin: 56% 98%;
}

.mascot-speech {
  top: var(--bubble-offset-y);
  right: calc(var(--mascot-size) * 0.12);
  z-index: 6;
  max-width: 184px;
  padding: 10px 14px;
  border-radius: 999px 999px 999px 14px;
  transform: translate3d(-12%, 0, 0);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.34),
    0 0 24px rgba(216, 190, 122, 0.18);
}

.mascot-speech::after {
  /* Downward speech tail: points from the bubble toward the mascot/head. */
  content: "";
  position: absolute;
  right: 34%;
  bottom: -9px;
  width: 18px;
  height: 12px;
  background: linear-gradient(180deg, rgba(216, 190, 122, 0.98), rgba(240, 223, 175, 0.94));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border: 0;
  border-radius: 0 0 3px 3px;
  filter: drop-shadow(0 6px 7px rgba(0, 0, 0, 0.22));
  transform: none;
}

.floating-mascot::after {
  /* Invisible hover bridge: keeps the contact state alive while moving from mascot to the icons. */
  content: "";
  position: absolute;
  right: calc(var(--mascot-size) * 0.06);
  top: calc(var(--mascot-size) * -0.56);
  z-index: 1;
  width: calc(var(--mascot-size) * 1.48);
  height: calc(var(--mascot-size) * 0.80);
  background: transparent;
}

.floating-mascot:hover .mascot-speech,
.floating-mascot:focus-within .mascot-speech,
.floating-mascot:focus-visible .mascot-speech,
.floating-mascot.is-open .mascot-speech {
  opacity: 0;
  visibility: hidden;
  transform: translate3d(-12%, -8px, 0) scale(0.96);
}

.mascot-socials {
  top: var(--social-offset-y);
  right: calc(var(--mascot-size) * 0.28);
  z-index: 7;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
}

.mascot-social {
  width: 46px;
  height: 46px;
  opacity: 0;
  transform: translate3d(28px, 84px, 0) scale(0.62);
  transition:
    opacity 210ms ease,
    transform 340ms cubic-bezier(0.16, 0.92, 0.2, 1.12),
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.mascot-tt {
  transition-delay: 42ms;
  transform: translate3d(16px, 94px, 0) scale(0.62);
}

.floating-mascot:hover .mascot-social,
.floating-mascot:focus-within .mascot-social,
.floating-mascot:focus-visible .mascot-social,
.floating-mascot.is-open .mascot-social {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.mascot-social:hover,
.mascot-social:focus-visible {
  transform: translate3d(0, -2px, 0) scale(1.04) !important;
}

@media (max-width: 820px) {
  .floating-mascot {
    --mascot-size: clamp(104px, 23vw, 142px);
    --bubble-offset-y: calc(var(--mascot-size) * -0.34);
    --social-offset-y: calc(var(--mascot-size) * -0.46);
    right: max(4px, env(safe-area-inset-right));
    bottom: max(-6px, env(safe-area-inset-bottom));
  }

  .mascot-speech {
    right: calc(var(--mascot-size) * 0.05);
    max-width: 146px;
    padding: 8px 11px;
    font-size: 0.68rem;
  }

  .floating-mascot::after {
    top: calc(var(--mascot-size) * -0.52);
    height: calc(var(--mascot-size) * 0.74);
  }

  .mascot-socials {
    right: calc(var(--mascot-size) * 0.20);
    gap: 8px;
  }

  .mascot-social {
    width: 42px;
    height: 42px;
    transform: translate3d(24px, 74px, 0) scale(0.64);
  }

  .mascot-tt {
    transform: translate3d(10px, 82px, 0) scale(0.64);
  }
}

@media (max-width: 520px) {
  .floating-mascot {
    --mascot-size: clamp(92px, 25vw, 118px);
    --bubble-offset-y: calc(var(--mascot-size) * -0.28);
    --social-offset-y: calc(var(--mascot-size) * -0.42);
    right: max(2px, env(safe-area-inset-right));
    bottom: max(-4px, env(safe-area-inset-bottom));
  }

  .mascot-speech {
    right: calc(var(--mascot-size) * -0.02);
    max-width: 124px;
    font-size: 0.62rem;
    padding: 7px 10px;
  }

  .floating-mascot::after {
    top: calc(var(--mascot-size) * -0.48);
    height: calc(var(--mascot-size) * 0.68);
  }

  .mascot-socials {
    right: calc(var(--mascot-size) * 0.12);
    gap: 7px;
  }

  .mascot-social {
    width: 38px;
    height: 38px;
  }

  .mascot-social svg {
    width: 18px;
    height: 18px;
  }
}

/* v26: proportional mascot sizing by viewport */
.floating-mascot {
  --mascot-size: clamp(118px, 7.2vw, 158px);
  width: calc(var(--mascot-size) * 1.18);
  min-height: calc(var(--mascot-size) * 2.08);
  right: max(8px, env(safe-area-inset-right));
  bottom: max(-6px, env(safe-area-inset-bottom));
}

.mascot-stage { min-height: calc(var(--mascot-size) * 2.08); }
.mascot-speech { right: calc(var(--mascot-size) * 0.08); }
.mascot-socials { right: calc(var(--mascot-size) * 0.24); }

@media (max-width: 820px) {
  .floating-mascot {
    --mascot-size: clamp(86px, 19vw, 112px);
    width: calc(var(--mascot-size) * 1.20);
    min-height: calc(var(--mascot-size) * 2.06);
    right: max(2px, env(safe-area-inset-right));
    bottom: max(-5px, env(safe-area-inset-bottom));
  }

  .mascot-stage { min-height: calc(var(--mascot-size) * 2.06); }

  .mascot-speech {
    top: calc(var(--mascot-size) * -0.30);
    right: calc(var(--mascot-size) * 0.02);
    max-width: 138px;
  }

  .floating-mascot::after {
    right: calc(var(--mascot-size) * 0.02);
    top: calc(var(--mascot-size) * -0.46);
    width: calc(var(--mascot-size) * 1.45);
    height: calc(var(--mascot-size) * 0.66);
  }

  .mascot-socials {
    top: calc(var(--mascot-size) * -0.40);
    right: calc(var(--mascot-size) * 0.14);
  }
}

@media (max-width: 520px) {
  .floating-mascot {
    --mascot-size: clamp(70px, 18vw, 88px);
    width: calc(var(--mascot-size) * 1.22);
  }

  .mascot-speech {
    top: calc(var(--mascot-size) * -0.24);
    right: calc(var(--mascot-size) * -0.10);
    max-width: 116px;
    font-size: 0.58rem;
    padding: 6px 9px;
  }

  .mascot-speech::after {
    right: 30%;
    bottom: -8px;
    width: 15px;
    height: 10px;
  }

  .mascot-socials {
    top: calc(var(--mascot-size) * -0.38);
    right: calc(var(--mascot-size) * 0.04);
    gap: 6px;
  }

  .mascot-social {
    width: 34px;
    height: 34px;
  }

  .mascot-social svg {
    width: 16px;
    height: 16px;
  }
}

/* v26.5.8 generated mascot sizing patch */
.lux-mascot-contact,
.floating-mascot {
  right: max(8px, env(safe-area-inset-right)) !important;
  bottom: max(0px, env(safe-area-inset-bottom)) !important;
  width: clamp(128px, 12.6vw, 214px) !important;
  z-index: 70 !important;
}

.lux-mascot-contact img,
.floating-mascot img,
.mascot-visual img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: bottom center !important;
}

.lux-mascot-contact .mascot-bubble,
.floating-mascot .mascot-bubble {
  top: clamp(-58px, -4.6vw, -42px) !important;
  right: clamp(16px, 3vw, 44px) !important;
}

@media (min-width: 821px) and (max-width: 1180px) {
  .lux-mascot-contact,
  .floating-mascot { width: clamp(122px, 15vw, 176px) !important; }
}

@media (max-width: 820px) {
  .lux-mascot-contact,
  .floating-mascot {
    width: clamp(104px, 31vw, 138px) !important;
    right: 4px !important;
  }
  .lux-mascot-contact .mascot-bubble,
  .floating-mascot .mascot-bubble {
    top: -42px !important;
    right: 8px !important;
  }
}

/* === v26.5.9 — mascot contact head-anchor correction ===
   Scope: real production selectors .mascot-speech + .mascot-socials.
   Keeps v26.5.8 mascot sizing baseline and moves the contact UI to one head anchor. */
.floating-mascot,
.lux-mascot-contact {
  --mascot-size: clamp(128px, 12.2vw, 214px);
  --mascot-head-top: clamp(-58px, -4.3vw, -42px);
  --mascot-head-right: clamp(4px, 1.25vw, 22px);
  --mascot-contact-gap: 8px;
  right: max(8px, env(safe-area-inset-right)) !important;
  bottom: max(0px, env(safe-area-inset-bottom)) !important;
  width: var(--mascot-size) !important;
  min-height: calc(var(--mascot-size) * 1.94) !important;
  z-index: 70 !important;
  isolation: isolate;
}

.mascot-stage {
  position: relative !important;
  width: 100% !important;
  min-height: calc(var(--mascot-size) * 1.94) !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
}

.floating-mascot img,
.lux-mascot-contact img,
.mascot-visual,
.mascot-visual img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: bottom center !important;
}

.mascot-speech,
.mascot-socials {
  position: absolute !important;
  top: var(--mascot-head-top) !important;
  right: var(--mascot-head-right) !important;
  z-index: 8 !important;
}

.mascot-speech {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  max-width: 178px !important;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  color: #11100c !important;
  background: linear-gradient(135deg, #ffe6aa, #d8be7a) !important;
  border: 1px solid rgba(255, 244, 206, 0.54) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255,255,255,.50) !important;
  font-size: clamp(.68rem, .7vw, .78rem) !important;
  font-weight: 800 !important;
  line-height: 1.18 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate3d(0, 0, 0) !important;
  transition: opacity 180ms ease, transform 220ms ease, visibility 180ms ease !important;
}

.mascot-speech::after {
  content: "" !important;
  position: absolute !important;
  right: clamp(34px, 2.8vw, 50px) !important;
  bottom: -9px !important;
  width: 18px !important;
  height: 12px !important;
  background: linear-gradient(135deg, #d8be7a, #ffe6aa) !important;
  clip-path: polygon(0 0, 100% 0, 52% 100%) !important;
  border: 0 !important;
  filter: drop-shadow(0 5px 6px rgba(0,0,0,.25)) !important;
}

.mascot-socials {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--mascot-contact-gap) !important;
  min-height: 40px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate3d(0, 0, 0) scale(.96) !important;
  transition: opacity 190ms ease, transform 260ms cubic-bezier(.16,.92,.2,1.12) !important;
}

.mascot-social {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  color: #11100c !important;
  background: linear-gradient(135deg, #ffe6aa, #d8be7a) !important;
  border: 1px solid rgba(255, 244, 206, .54) !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.54) !important;
  opacity: 0 !important;
  pointer-events: auto !important;
  transform: scale(.78) !important;
  transition: opacity 180ms ease, transform 260ms cubic-bezier(.16,.92,.2,1.12), filter 180ms ease !important;
}

.mascot-social svg {
  width: 19px !important;
  height: 19px !important;
}

.floating-mascot:hover .mascot-speech,
.floating-mascot:focus-within .mascot-speech,
.floating-mascot:focus-visible .mascot-speech,
.floating-mascot.is-open .mascot-speech,
.lux-mascot-contact:hover .mascot-speech,
.lux-mascot-contact:focus-within .mascot-speech,
.lux-mascot-contact.is-open .mascot-speech {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translate3d(0, -4px, 0) scale(.94) !important;
}

.floating-mascot:hover .mascot-socials,
.floating-mascot:focus-within .mascot-socials,
.floating-mascot:focus-visible .mascot-socials,
.floating-mascot.is-open .mascot-socials,
.lux-mascot-contact:hover .mascot-socials,
.lux-mascot-contact:focus-within .mascot-socials,
.lux-mascot-contact.is-open .mascot-socials {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
}

.floating-mascot:hover .mascot-social,
.floating-mascot:focus-within .mascot-social,
.floating-mascot:focus-visible .mascot-social,
.floating-mascot.is-open .mascot-social,
.lux-mascot-contact:hover .mascot-social,
.lux-mascot-contact:focus-within .mascot-social,
.lux-mascot-contact.is-open .mascot-social {
  opacity: 1 !important;
  transform: scale(1) !important;
}

.mascot-social:hover,
.mascot-social:focus-visible {
  filter: brightness(1.08) !important;
  outline: 2px solid rgba(253, 219, 148, .44) !important;
  outline-offset: 3px !important;
  transform: scale(1.06) !important;
}

@media (min-width: 821px) and (max-width: 1180px) {
  .floating-mascot,
  .lux-mascot-contact {
    --mascot-size: clamp(122px, 14vw, 176px);
    --mascot-head-top: clamp(-54px, -4.4vw, -40px);
    --mascot-head-right: clamp(2px, 1vw, 16px);
    right: max(4px, env(safe-area-inset-right)) !important;
  }
}

@media (max-width: 820px) {
  .floating-mascot,
  .lux-mascot-contact {
    --mascot-size: clamp(104px, 30vw, 138px);
    --mascot-head-top: -46px;
    --mascot-head-right: 0px;
    right: max(2px, env(safe-area-inset-right)) !important;
    bottom: max(-3px, env(safe-area-inset-bottom)) !important;
    min-height: calc(var(--mascot-size) * 1.94) !important;
  }

  .mascot-stage { min-height: calc(var(--mascot-size) * 1.94) !important; }
  .mascot-speech { max-width: 136px !important; min-height: 36px !important; padding: 7px 11px !important; font-size: .62rem !important; }
  .mascot-socials { gap: 6px !important; min-height: 36px !important; }
  .mascot-social { width: 36px !important; height: 36px !important; min-width: 36px !important; min-height: 36px !important; }
  .mascot-social svg { width: 17px !important; height: 17px !important; }
}

@media (max-width: 520px) {
  .floating-mascot,
  .lux-mascot-contact {
    --mascot-size: clamp(82px, 28vw, 112px);
    --mascot-head-top: -40px;
    --mascot-head-right: -2px;
    right: max(0px, env(safe-area-inset-right)) !important;
  }

  .mascot-speech { max-width: 116px !important; min-height: 34px !important; padding: 6px 9px !important; font-size: .56rem !important; }
  .mascot-speech::after { right: 24px !important; bottom: -8px !important; width: 15px !important; height: 10px !important; }
  .mascot-social { width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-speech,
  .mascot-socials,
  .mascot-social { transition: none !important; }
}


/* === v26.5.12 — mascot contact bubble final lift + tail alignment ===
   Fixes v26.5.9 issue where the contact speech/social cluster floated too high.
   Uses bottom-based anchoring so the bubble stays tied to the mascot head even when
   older v19/v20/v26 min-height rules are present. */
.floating-mascot,
.lux-mascot-contact {
  --mascot-size: clamp(128px, 12.2vw, 214px) !important;
  --mascot-visual-height: calc(var(--mascot-size) * 0.95) !important;
  --mascot-contact-bottom: calc(var(--mascot-size) * 0.94) !important;
  --mascot-contact-right: calc(var(--mascot-size) * 0.14) !important;
  position: fixed !important;
  right: max(8px, env(safe-area-inset-right)) !important;
  bottom: max(0px, env(safe-area-inset-bottom)) !important;
  width: var(--mascot-size) !important;
  min-height: var(--mascot-visual-height) !important;
  height: var(--mascot-visual-height) !important;
  padding: 0 !important;
  overflow: visible !important;
  z-index: 70 !important;
}

.floating-mascot::before,
.lux-mascot-contact::before {
  inset: auto 0 0 0 !important;
  height: var(--mascot-visual-height) !important;
  pointer-events: none !important;
}

.floating-mascot::after,
.lux-mascot-contact::after {
  content: "" !important;
  position: absolute !important;
  inset: auto calc(var(--mascot-size) * -0.18) calc(var(--mascot-size) * 0.56) calc(var(--mascot-size) * -0.34) !important;
  height: calc(var(--mascot-size) * 0.42) !important;
  background: transparent !important;
  pointer-events: auto !important;
}

.mascot-stage {
  position: relative !important;
  width: 100% !important;
  min-height: var(--mascot-visual-height) !important;
  height: var(--mascot-visual-height) !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  overflow: visible !important;
}

.mascot-visual,
.floating-mascot > .mascot-stage > .mascot-visual,
.floating-mascot img,
.lux-mascot-contact img {
  width: var(--mascot-size) !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: bottom center !important;
}

.mascot-speech,
.mascot-socials {
  top: auto !important;
  left: auto !important;
  right: var(--mascot-contact-right) !important;
  bottom: var(--mascot-contact-bottom) !important;
  z-index: 9 !important;
}

.mascot-speech {
  min-height: 38px !important;
  padding: 8px 14px !important;
  transform: translate3d(0, 0, 0) !important;
}

.mascot-speech::after {
  right: clamp(34px, 2.8vw, 50px) !important;
  bottom: -9px !important;
  transform: none !important;
}

.mascot-socials {
  transform: translate3d(0, 0, 0) scale(.96) !important;
}

.floating-mascot:hover .mascot-speech,
.floating-mascot:focus-within .mascot-speech,
.floating-mascot:focus-visible .mascot-speech,
.floating-mascot.is-open .mascot-speech,
.lux-mascot-contact:hover .mascot-speech,
.lux-mascot-contact:focus-within .mascot-speech,
.lux-mascot-contact.is-open .mascot-speech {
  transform: translate3d(0, -4px, 0) scale(.94) !important;
}

@media (min-width: 821px) and (max-width: 1180px) {
  .floating-mascot,
  .lux-mascot-contact {
    --mascot-size: clamp(122px, 14vw, 176px) !important;
    --mascot-contact-bottom: calc(var(--mascot-size) * 0.92) !important;
    --mascot-contact-right: calc(var(--mascot-size) * 0.11) !important;
    right: max(4px, env(safe-area-inset-right)) !important;
  }
}

@media (max-width: 820px) {
  .floating-mascot,
  .lux-mascot-contact {
    --mascot-size: clamp(104px, 30vw, 138px) !important;
    --mascot-contact-bottom: calc(var(--mascot-size) * 0.89) !important;
    --mascot-contact-right: calc(var(--mascot-size) * 0.09) !important;
    right: max(2px, env(safe-area-inset-right)) !important;
    bottom: max(-3px, env(safe-area-inset-bottom)) !important;
  }

  .mascot-speech {
    min-height: 36px !important;
    padding: 7px 11px !important;
    font-size: .62rem !important;
  }

  .mascot-socials { gap: 6px !important; min-height: 36px !important; }
  .mascot-social { width: 36px !important; height: 36px !important; min-width: 36px !important; min-height: 36px !important; }
  .mascot-social svg { width: 17px !important; height: 17px !important; }
}

@media (max-width: 520px) {
  .floating-mascot,
  .lux-mascot-contact {
    --mascot-size: clamp(82px, 28vw, 112px) !important;
    --mascot-contact-bottom: calc(var(--mascot-size) * 0.87) !important;
    --mascot-contact-right: calc(var(--mascot-size) * 0.05) !important;
    right: max(0px, env(safe-area-inset-right)) !important;
  }

  .mascot-speech {
    max-width: 116px !important;
    min-height: 34px !important;
    padding: 6px 9px !important;
    font-size: .56rem !important;
  }

  .mascot-speech::after {
    right: 32px !important;
    bottom: -8px !important;
    width: 15px !important;
    height: 10px !important;
  }

  .mascot-social { width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; }
}
