/* Storefront floating widget — below popups (z-index 9000), above main content */
.m-fw {
  --fw-offset-y: 0px;
  --fw-gap: 16px;
  position: fixed;
  z-index: 8000;
  max-width: min(360px, calc(100vw - 24px));
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  box-sizing: border-box;
}

.m-fw[hidden] {
  display: none !important;
}

.m-fw *,
.m-fw *::before,
.m-fw *::after {
  box-sizing: border-box;
}

.m-fw--bottom-right {
  right: var(--fw-gap);
  bottom: calc(var(--fw-gap) + var(--fw-offset-y));
}

.m-fw--bottom-left {
  left: var(--fw-gap);
  bottom: calc(var(--fw-gap) + var(--fw-offset-y));
}

.m-fw--left-center {
  left: var(--fw-gap);
  top: 50%;
  transform: translateY(calc(-50% + var(--fw-offset-y)));
}

.m-fw--right-center {
  right: var(--fw-gap);
  top: 50%;
  transform: translateY(calc(-50% + var(--fw-offset-y)));
}

.m-fw__launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
  transition: background-color 220ms ease, transform 220ms ease;
}

.m-fw__launcher:hover {
  background: #1e293b;
}

.m-fw__launcher:active {
  transform: scale(0.98);
}

.m-fw__launcher:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.m-fw__panel {
  position: relative;
  width: fit-content;
  max-width: min(360px, calc(100vw - 24px));
  max-height: min(70vh, 480px);
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.m-fw--collapse .m-fw__panel {
  margin-bottom: 0.65rem;
}

.m-fw--collapse.m-fw--bottom-right,
.m-fw--collapse.m-fw--bottom-left {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
}

.m-fw--collapse.m-fw--bottom-left {
  align-items: flex-start;
}

.m-fw--collapse.m-fw--left-center,
.m-fw--collapse.m-fw--right-center {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.m-fw--collapse.m-fw--right-center {
  align-items: flex-end;
}

.m-fw__panel[hidden] {
  display: none !important;
}

/* Shrink-wrap to content so × sits on the content corner, not a 360px shell */
.m-fw__frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: min(70vh, 480px);
  overflow: auto;
  vertical-align: top;
  line-height: 0;
}

.m-fw__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #000;
  font-size: 1.35rem;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  text-shadow:
    0 0 2px #fff,
    0 0 4px #fff,
    1px 0 0 #fff,
    -1px 0 0 #fff,
    0 1px 0 #fff,
    0 -1px 0 #fff;
}

.m-fw__close:hover {
  background: transparent;
  color: #000;
  opacity: 0.8;
}

.m-fw__close:active {
  transform: scale(0.96);
}

.m-fw__close:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.m-fw__body {
  display: block;
  padding: 0;
  margin: 0;
  font-size: inherit;
  line-height: normal;
  background: transparent;
}

.m-fw__body > :first-child {
  margin-top: 0;
}

.m-fw__body > :last-child {
  margin-bottom: 0;
}

.m-fw__body img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* CSS bob is a fallback; JS rAF drives float when On (beats template reduced-motion animation kill). */
@keyframes m-fw-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-22px);
  }
}

.m-fw--float .m-fw__frame,
.m-fw--float .m-fw__launcher {
  animation: m-fw-bob 2.2s ease-in-out infinite;
  will-change: transform;
}

/* Override skin `* { animation-duration: 0.01ms !important }` under prefers-reduced-motion */
body.m-template-casino-blue .m-fw--float .m-fw__frame,
body.m-template-casino-blue .m-fw--float .m-fw__launcher,
body.m-template-casino-gold .m-fw--float .m-fw__frame,
body.m-template-casino-gold .m-fw--float .m-fw__launcher,
.m-fw--float .m-fw__frame,
.m-fw--float .m-fw__launcher {
  animation-name: m-fw-bob !important;
  animation-duration: 2.2s !important;
  animation-timing-function: ease-in-out !important;
  animation-iteration-count: infinite !important;
  animation-delay: 0s !important;
  animation-fill-mode: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .m-fw__launcher,
  .m-fw__close {
    transition: none;
  }

  .m-fw__close:active {
    transform: none;
  }

  body.m-template-casino-blue .m-fw--float .m-fw__frame,
  body.m-template-casino-blue .m-fw--float .m-fw__launcher,
  body.m-template-casino-gold .m-fw--float .m-fw__frame,
  body.m-template-casino-gold .m-fw--float .m-fw__launcher,
  .m-fw--float .m-fw__frame,
  .m-fw--float .m-fw__launcher {
    animation-name: m-fw-bob !important;
    animation-duration: 2.2s !important;
    animation-timing-function: ease-in-out !important;
    animation-iteration-count: infinite !important;
  }
}
