/**
 * Desktop floating assist rail (email / phone / WhatsApp / cart / top).
 * Hidden below 1024px. When visible, body.has-mz-float reserves --float-safe
 * so .shell content is not covered by the rail.
 */

.mz-float {
  --mz-float-size: 48px;
  --mz-float-gap: 0;
  position: fixed;
  right: max(1.1rem, env(safe-area-inset-right, 0px));
  top: 50%;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  transform: translateY(-50%);
  pointer-events: none;
  font-family: var(--font-ui, "Manrope", "Source Sans 3", sans-serif);
}

@media (min-width: 1024px) {
  body.has-mz-float {
    /* icon column + right offset + breathing room past content */
    --float-safe: 4.75rem;
  }
}

.mz-float-stack,
.mz-float-top-wrap {
  pointer-events: auto;
}

.mz-float-stack {
  display: flex;
  flex-direction: column;
  width: var(--mz-float-size);
  background: #fff;
  border: 1px solid var(--line, #e6e8ec);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(21, 21, 21, 0.1);
  overflow: visible;
}

.mz-float-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mz-float-item + .mz-float-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--line, #e6e8ec);
  pointer-events: none;
}

.mz-float-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--mz-float-size);
  height: var(--mz-float-size);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #151515;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.18s var(--ease, cubic-bezier(0.32, 0.72, 0, 1)), background 0.18s var(--ease, cubic-bezier(0.32, 0.72, 0, 1));
}

.mz-float-item:first-child .mz-float-btn {
  border-radius: 10px 10px 0 0;
}

.mz-float-item:last-child .mz-float-btn {
  border-radius: 0 0 10px 10px;
}

.mz-float-item:only-child .mz-float-btn {
  border-radius: 10px;
}

.mz-float-btn:hover,
.mz-float-btn:focus-visible,
.mz-float-item:focus-within .mz-float-btn {
  color: var(--brand, #0b3a6e);
  background: var(--accent-soft, rgba(11, 58, 110, 0.08));
  outline: none;
}

.mz-float-btn svg {
  display: block;
  flex-shrink: 0;
}

.mz-float-cart-count {
  position: absolute;
  top: 8px;
  right: 7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand, #0b3a6e);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.mz-float-cart-count[hidden] {
  display: none !important;
}

.mz-float-pop {
  position: absolute;
  right: 100%;
  top: 50%;
  width: min(294px, calc(100vw - 5rem));
  padding: 14px 30px 16px 16px; /* right padding bridges the visual gap */
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--text, #151515);
  opacity: 0;
  visibility: hidden;
  transform: translate(4px, -50%);
  transition: opacity 0.18s var(--ease, cubic-bezier(0.32, 0.72, 0, 1)), transform 0.18s var(--ease, cubic-bezier(0.32, 0.72, 0, 1)), visibility 0.18s;
  pointer-events: none;
  z-index: 2;
}

/* White card + shadow sit inset so the right padding stays a transparent hover bridge */
.mz-float-pop::before {
  content: "";
  position: absolute;
  inset: 0 14px 0 0;
  background: #fff;
  border: 1px solid var(--line, #e6e8ec);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(21, 21, 21, 0.14);
  z-index: -1;
  pointer-events: none;
}

.mz-float-pop::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 1px solid var(--line, #e6e8ec);
  border-top: 1px solid var(--line, #e6e8ec);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.mz-float-pop > * {
  position: relative;
  z-index: 1;
}

.mz-float-item:hover .mz-float-pop,
.mz-float-item:focus-within .mz-float-pop {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
  pointer-events: auto;
}

.mz-float-pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--brand, #0b3a6e);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mz-float-pop-head svg {
  flex-shrink: 0;
}

.mz-float-pop-value {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 600;
  word-break: break-word;
}

.mz-float-pop-value a {
  color: inherit;
  text-decoration: none;
}

.mz-float-pop-value a:hover {
  color: var(--brand, #0b3a6e);
  text-decoration: underline;
}

.mz-float-pop-note {
  margin: 0 0 12px;
  color: var(--text-muted, #5c6670);
  font-size: 0.84rem;
  line-height: 1.45;
}

.mz-float-pop-qr {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
  padding: 8px;
  background: var(--surface, #f5f6f8);
  border-radius: 8px;
}

.mz-float-pop-qr img {
  width: 132px;
  height: 132px;
  object-fit: contain;
}

.mz-float-pop-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: var(--brand, #0b3a6e);
  color: #fff !important;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.16s ease;
}

.mz-float-pop-cta:hover,
.mz-float-pop-cta:focus-visible {
  background: var(--brand-hover, #145a9e);
  outline: none;
}

.mz-float-top-wrap {
  width: var(--mz-float-size);
}

.mz-float-top {
  width: var(--mz-float-size);
  height: var(--mz-float-size);
  border-radius: 10px !important;
  background: #fff !important;
  border: 1px solid var(--line, #e6e8ec) !important;
  box-shadow: 0 10px 28px rgba(21, 21, 21, 0.1);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.18s ease, background 0.18s ease;
}

.mz-float-top.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
}

@media (max-width: 1023px) {
  .mz-float {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mz-float-btn,
  .mz-float-pop,
  .mz-float-top,
  .mz-float-pop-cta {
    transition: none;
  }
}
