.mag-floating-home {
  --mag-cycle: 7s;
  --mag-phase: 0.7s;
  --mag-hold: calc(var(--mag-cycle) * 0.34);
  --mag-ease: ease-in-out;
  position: fixed;
  right: 24px;
  bottom: 48px;
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 14px;
  border-radius: 999px;
  background-color: #876c47;
  color: #fff;
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transition:
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

.mag-floating-home:hover {
  background-color: #6f5738;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  color: #fff;
}

.mag-floating-home__text {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.mag-floating-home__label {
  display: inline-block;
  padding-right: 0;
  color: #fff;
  transform: translateX(16px);
  opacity: 0;
  line-height: normal;
}

.mag-floating-home svg {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  color: #fff;
  stroke: #fff;
  margin-left: 0;
}

.mag-floating-home--loop .mag-floating-home__text {
  animation: mag-text-wrap var(--mag-cycle) var(--mag-ease) infinite;
}

.mag-floating-home--loop .mag-floating-home__label {
  animation: mag-text-slide var(--mag-cycle) var(--mag-ease) infinite;
}

.mag-floating-home--loop svg {
  animation: mag-icon-gap var(--mag-cycle) var(--mag-ease) infinite;
}

.mag-floating-home--open .mag-floating-home__text {
  animation: mag-text-wrap-open var(--mag-phase) var(--mag-ease) forwards;
}

.mag-floating-home--open .mag-floating-home__label {
  animation: mag-text-slide-open var(--mag-phase) var(--mag-ease) forwards;
}

.mag-floating-home--open svg {
  animation: mag-icon-gap-open var(--mag-phase) var(--mag-ease) forwards;
}

.mag-floating-home--hold .mag-floating-home__text {
  max-width: 180px;
}

.mag-floating-home--hold .mag-floating-home__label {
  transform: translateX(0);
  opacity: 1;
}

.mag-floating-home--hold svg {
  margin-left: 14px;
}

.mag-floating-home--close .mag-floating-home__text {
  animation: mag-text-wrap-close var(--mag-phase) var(--mag-ease) forwards;
}

.mag-floating-home--close .mag-floating-home__label {
  animation: mag-text-slide-close var(--mag-phase) var(--mag-ease) forwards;
}

.mag-floating-home--close svg {
  animation: mag-icon-gap-close var(--mag-phase) var(--mag-ease) forwards;
}

@keyframes mag-text-wrap {
  0%,
  18% {
    max-width: 0;
  }
  28%,
  62% {
    max-width: 180px;
  }
  72%,
  100% {
    max-width: 0;
  }
}

@keyframes mag-text-wrap-open {
  from {
    max-width: 0;
  }
  to {
    max-width: 180px;
  }
}

@keyframes mag-text-wrap-close {
  from {
    max-width: 180px;
  }
  to {
    max-width: 0;
  }
}

@keyframes mag-text-slide {
  0%,
  18% {
    transform: translateX(16px);
    opacity: 0;
  }
  28%,
  62% {
    transform: translateX(0);
    opacity: 1;
  }
  72%,
  100% {
    transform: translateX(16px);
    opacity: 0;
  }
}

@keyframes mag-text-slide-open {
  from {
    transform: translateX(16px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes mag-text-slide-close {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(16px);
    opacity: 0;
  }
}

@keyframes mag-icon-gap {
  0%,
  18% {
    margin-left: 0;
  }
  28%,
  62% {
    margin-left: 14px;
  }
  72%,
  100% {
    margin-left: 0;
  }
}

@keyframes mag-icon-gap-open {
  from {
    margin-left: 0;
  }
  to {
    margin-left: 14px;
  }
}

@keyframes mag-icon-gap-close {
  from {
    margin-left: 14px;
  }
  to {
    margin-left: 0;
  }
}

@media (max-width: 767px) {
  .mag-floating-home {
    right: 16px;
    bottom: 36px;
    padding: 12px;
    font-size: 13px;
  }

  .mag-floating-home svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
  }
}
