.home-salon-promo {
  --salon-cat-width: 77px;
  --salon-cat-height: 116px;
  --salon-wave-angle: 7deg;
  --salon-cat-image: image-set(
    url("../img/salon-cat-heart-desktop-v3-1x.webp") 1x,
    url("../img/salon-cat-heart-desktop-v3-2x.webp") 2x,
    url("../img/salon-cat-heart-desktop-v3-3x.webp") 3x
  );
  bottom: calc(var(--salon-footer-height, 0px) + max(18px, env(safe-area-inset-bottom, 0px)));
  position: fixed;
  /* Place the cat 20px outside the canvas, including its link's 12px right margin. */
  right: max(22px, calc((100% - var(--site-canvas-width, 1180px)) / 2 - var(--salon-cat-width) - 32px), env(safe-area-inset-right, 0px));
  width: 132px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
  z-index: 100;
}

.home-salon-promo__link {
  color: #303030;
  display: block;
  margin-left: auto;
  margin-right: 12px;
  pointer-events: auto;
  text-decoration: none !important;
  width: var(--salon-cat-width);
}

.home-salon-promo__message {
  bottom: calc(var(--salon-cat-height) + 7px);
  max-width: min(280px, calc(100vw - 44px));
  min-width: 100%;
  position: absolute;
  right: 0;
  width: max-content;
}

.home-salon-promo__message[hidden] {
  display: none;
}

.home-salon-promo__bubble {
  background: #fff;
  border: 1px solid #d5d5d5;
  border-radius: 16px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.09);
  box-sizing: border-box;
  color: #303030;
  display: block;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
  padding: 9px 8px;
  pointer-events: auto;
  position: relative;
  text-align: center;
  text-decoration: none !important;
  width: 100%;
}

.home-salon-promo__close {
  align-items: center;
  background: #fff;
  border: 1px solid #d5d5d5;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  height: 22px;
  justify-content: center;
  padding: 0;
  pointer-events: auto;
  position: absolute;
  right: -6px;
  top: -8px;
  width: 22px;
}

.home-salon-promo__bubble [data-home-salon-text] {
  display: block;
  max-height: min(260px, 40vh);
  overflow-y: auto;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.home-salon-promo__close img {
  display: block;
  opacity: 0.65;
}

.home-salon-promo__close:hover img {
  opacity: 1;
}

.home-salon-promo__bubble::after {
  background: #fff;
  border-bottom: 1px solid #d5d5d5;
  border-right: 1px solid #d5d5d5;
  bottom: -6px;
  content: "";
  height: 10px;
  position: absolute;
  right: calc(var(--salon-cat-width) / 2 + 7px);
  transform: rotate(45deg);
  width: 10px;
}

.home-salon-promo__cat,
.home-salon-promo__frame {
  background-image: var(--salon-cat-image);
  background-repeat: no-repeat;
  background-size: 200% 100%;
}

.home-salon-promo__cat {
  background-position: 0 0;
  display: block;
  height: var(--salon-cat-height);
  pointer-events: auto;
  position: relative;
  width: var(--salon-cat-width);
}

.home-salon-promo__frame {
  animation: home-salon-wave 3.2s ease-in-out -0.8s infinite;
  background-position: 100% 0;
  height: 100%;
  left: -8%;
  pointer-events: none;
  position: absolute;
  top: -2%;
  transform-origin: 54% 71%;
  width: 100%;
}

.home-salon-promo__link:focus-visible,
.home-salon-promo__bubble:focus-visible,
.home-salon-promo__close:focus-visible {
  outline: 2px solid #795548;
  outline-offset: 4px;
}

body.journal-lightbox-open .home-salon-promo,
body.is-detail-image-fullscreen-open .home-salon-promo,
body:has(dialog[open]) .home-salon-promo,
:root:has(:fullscreen) .home-salon-promo {
  visibility: hidden;
}

@keyframes home-salon-wave {
  0%, 100% { transform: rotate(calc(-1 * var(--salon-wave-angle))); }
  50% { transform: rotate(var(--salon-wave-angle)); }
}

@media (max-width: 720px) {
  .home-salon-promo {
    --salon-cat-width: 58px;
    --salon-cat-height: 87px;
    --salon-cat-image: image-set(
      url("../img/salon-cat-heart-mobile-v3-1x.webp") 1x,
      url("../img/salon-cat-heart-mobile-v3-2x.webp") 2x,
      url("../img/salon-cat-heart-mobile-v3-3x.webp") 3x
    );
    bottom: max(var(--salon-footer-height, 0px), env(safe-area-inset-bottom, 0px));
    right: max(14px, env(safe-area-inset-right, 0px));
    width: 120px;
  }

  body:has(.mobile-magnet-menu) .home-salon-promo {
    --salon-footer-height: 78px;
  }

  .home-salon-promo__bubble {
    font-size: 13px;
    padding: 8px 7px;
  }

  body:has(input:focus, textarea:focus, [contenteditable="true"]:focus) .home-salon-promo {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-salon-promo { --salon-wave-angle: 3deg; }
  .home-salon-promo__frame {
    animation-delay: -1.2s;
    animation-duration: 4.8s;
  }
}

@media print {
  .home-salon-promo { display: none; }
}
