/* Girasole Mascot ("Giro") & 5-second virtual assistant popup */
body:not(.chat-launcher-ready) #open-chat,
body.has-mascot-launcher #open-chat {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0.75);
}

body.chat-launcher-ready:not(.has-mascot-launcher) #open-chat {
  visibility: visible;
}

.girasole-mascot-root[hidden] {
  display: none;
}

body:has(#chat-dialog[open]) .girasole-mascot-root {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.girasole-mascot-root {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 35;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(36px) scale(0.72);
  transition: opacity .55s cubic-bezier(.22, 1, .36, 1), transform .65s cubic-bezier(.34, 1.56, .64, 1), bottom .28s ease;
}

.girasole-mascot-root.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.has-sticky-active .girasole-mascot-root {
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.girasole-mascot-btn {
  pointer-events: auto;
  position: relative;
  width: 148px;
  height: 188px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 720px;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  outline-offset: 6px;
}

.girasole-mascot-btn::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 68%;
  height: 15px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(24, 48, 38, 0.36) 0%, rgba(24, 48, 38, 0) 72%);
  animation: girasole-shadow-pulse 3.1s ease-in-out infinite;
  pointer-events: none;
}

.girasole-mascot-stage {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform .22s ease-out;
}

.girasole-mascot-body {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 85%;
  animation: girasole-mascot-float 3.1s ease-in-out infinite;
  filter: drop-shadow(0 12px 18px rgba(18, 40, 31, 0.24));
  transition: filter .6s ease;
}

.girasole-mascot-btn:hover .girasole-mascot-body {
  filter: drop-shadow(0 18px 26px rgba(18, 40, 31, 0.34));
}

.girasole-mascot-root.is-waving .girasole-mascot-body {
  animation: girasole-mascot-wave 1.1s cubic-bezier(.34, 1.56, .64, 1);
}

.girasole-mascot-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 1;
}

.girasole-mascot-popup {
  pointer-events: auto;
  position: relative;
  width: min(296px, calc(100vw - 144px));
  background: var(--paper, #fcfbf7);
  color: var(--ink, #303a32);
  border: 1px solid var(--line, #d9d8cc);
  border-radius: 20px;
  padding: 15px 16px 14px;
  box-shadow: 0 18px 40px rgba(16, 36, 29, 0.18), 0 2px 8px rgba(16, 36, 29, 0.06);
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  transition: opacity .4s cubic-bezier(.22, 1, .36, 1) .18s, transform .45s cubic-bezier(.22, 1, .36, 1) .18s;
}

.girasole-mascot-root.is-visible .girasole-mascot-popup:not([hidden]) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.girasole-mascot-popup[hidden] {
  display: none;
}

.girasole-mascot-popup::after {
  content: '';
  position: absolute;
  right: -7px;
  bottom: 24px;
  width: 13px;
  height: 13px;
  background: var(--paper, #fcfbf7);
  border-right: 1px solid var(--line, #d9d8cc);
  border-bottom: 1px solid var(--line, #d9d8cc);
  transform: rotate(-45deg);
}

.girasole-mascot-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.girasole-mascot-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold, #806a46);
}

.girasole-mascot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9e66;
  box-shadow: 0 0 0 3px rgba(47, 158, 102, 0.18);
}

.girasole-mascot-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line, #d9d8cc);
  background: transparent;
  color: var(--muted, #62675d);
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.girasole-mascot-close:hover {
  background: rgba(37, 60, 50, 0.08);
  color: var(--pine, #253c32);
}

.girasole-mascot-text {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink, #303a32);
}

.girasole-mascot-cta {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--pine, #253c32);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  transition: background .2s ease, transform .15s ease, box-shadow .25s ease;
}

.girasole-mascot-cta:hover {
  background: #355245;
}

.girasole-mascot-cta:active {
  transform: scale(0.98);
}

.girasole-mascot-cta.is-highlighted {
  box-shadow: 0 0 0 3px rgba(255, 190, 11, 0.65), 0 8px 22px rgba(37, 60, 50, 0.28);
  transform: scale(1.03);
}

@keyframes girasole-mascot-float {
  0%, 100% { transform: translateY(0px) rotateY(-8deg) rotateZ(-2deg) scale(1, 1); }
  50% { transform: translateY(-10px) rotateY(8deg) rotateZ(2deg) scale(1.02, 0.99); }
}

@keyframes girasole-mascot-wave {
  0% { transform: translateY(0) rotateZ(0deg) scale(1); }
  22% { transform: translateY(-16px) rotateZ(-7deg) scale(1.04, 0.97); }
  50% { transform: translateY(-4px) rotateZ(7deg) scale(0.98, 1.04); }
  75% { transform: translateY(-12px) rotateZ(-4deg) scale(1.02, 0.99); }
  100% { transform: translateY(0) rotateZ(0deg) scale(1); }
}

@keyframes girasole-shadow-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.9; }
  50% { transform: translateX(-50%) scale(0.8); opacity: 0.5; }
}

@media (max-width: 760px) {
  .girasole-mascot-root {
    right: 12px;
    bottom: 14px;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 8px;
  }
  .girasole-mascot-btn {
    width: 108px;
    height: 138px;
  }
  .girasole-mascot-popup {
    width: min(272px, calc(100vw - 24px));
  }
  .girasole-mascot-popup::after {
    right: 30px;
    bottom: -7px;
    transform: rotate(45deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .girasole-mascot-body,
  .girasole-mascot-btn::after {
    animation: none !important;
  }
  .girasole-mascot-root,
  .girasole-mascot-popup {
    transition: none !important;
  }
}
