/* HOB menu — espresso-bean order FAB (browse-only page CTA) */

.hob-order-orb-wrap {
  --orb: 58px;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 58;
  animation: hob-orb-enter 0.7s cubic-bezier(0.22, 1.1, 0.36, 1) both;
}

.hob-order-orb-wrap.is-dismissed {
  display: none;
}

.hob-order-orb {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  max-width: calc(100vw - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  font-family: Poppins, system-ui, sans-serif;
  cursor: pointer;
  text-decoration: none;
  color: #F6EFE6;
  -webkit-tap-highlight-color: transparent;
}

.hob-order-orb__ring {
  position: absolute;
  left: 0;
  top: 50%;
  width: var(--orb);
  height: var(--orb);
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  border: 2px solid rgba(201, 122, 72, 0.45);
  animation: hob-orb-ring 2.8s ease-out infinite;
}

.hob-order-orb__core {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: var(--orb);
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, #3d2a1e 0%, #2B1B12 55%, #1a100c 100%);
  box-shadow:
    0 14px 32px rgba(43, 27, 18, 0.38),
    0 0 0 1px rgba(255, 236, 210, 0.12) inset,
    0 1px 0 rgba(255, 220, 180, 0.18) inset;
  overflow: hidden;
  transition:
    padding 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    gap 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  animation: hob-orb-bob 3.4s ease-in-out infinite;
}

.hob-order-orb__bean {
  flex: none;
  width: var(--orb);
  height: var(--orb);
  display: grid;
  place-items: center;
}

.hob-order-orb__bean svg {
  width: 30px;
  height: 30px;
  display: block;
}

.hob-order-orb__label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #F6EFE6;
  transition:
    max-width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    padding 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 0;
}

.hob-order-orb__label span {
  display: block;
  padding-right: 4px;
}

.hob-order-orb__steam {
  position: absolute;
  left: calc(var(--orb) / 2);
  top: 4px;
  width: 18px;
  height: 14px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.7;
}

.hob-order-orb__steam i {
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 10px;
  border-radius: 2px;
  background: rgba(246, 239, 230, 0.55);
  animation: hob-orb-steam 2.2s ease-in-out infinite;
}

.hob-order-orb__steam i:nth-child(1) { left: 3px; animation-delay: 0s; }
.hob-order-orb__steam i:nth-child(2) { left: 8px; animation-delay: 0.35s; height: 12px; }
.hob-order-orb__steam i:nth-child(3) { left: 13px; animation-delay: 0.7s; }

/* Expand on hover / focus / open (tap) */
.hob-order-orb:hover .hob-order-orb__core,
.hob-order-orb:focus-visible .hob-order-orb__core,
.hob-order-orb.is-open .hob-order-orb__core {
  padding-right: 18px;
  gap: 2px;
  box-shadow:
    0 18px 40px rgba(43, 27, 18, 0.45),
    0 0 0 1px rgba(255, 236, 210, 0.16) inset,
    0 0 24px rgba(201, 122, 72, 0.22);
  transform: translateY(-2px) scale(1.02);
  animation: none;
}

.hob-order-orb:hover .hob-order-orb__label,
.hob-order-orb:focus-visible .hob-order-orb__label,
.hob-order-orb.is-open .hob-order-orb__label {
  max-width: 140px;
  opacity: 1;
}

.hob-order-orb:hover .hob-order-orb__ring,
.hob-order-orb:focus-visible .hob-order-orb__ring,
.hob-order-orb.is-open .hob-order-orb__ring {
  animation: none;
  opacity: 0;
}

.hob-order-orb:focus-visible {
  outline: none;
}

.hob-order-orb:focus-visible .hob-order-orb__core {
  outline: 2px solid #2C8C7C;
  outline-offset: 3px;
}

.hob-order-orb:active .hob-order-orb__core {
  transform: translateY(0) scale(0.98);
}

/* Soft amber tip on the bean crease */
.hob-order-orb__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 28%, rgba(232, 168, 98, 0.22), transparent 55%);
  pointer-events: none;
}

.hob-order-orb__dismiss {
  position: absolute;
  top: -6px;
  left: -6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 252, 248, 0.92);
  color: #2B1B12;
  box-shadow: 0 4px 12px rgba(120, 96, 74, 0.28);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.hob-order-orb__dismiss svg {
  width: 10px;
  height: 10px;
  display: block;
}

.hob-order-orb-wrap:hover .hob-order-orb__dismiss,
.hob-order-orb-wrap:focus-within .hob-order-orb__dismiss,
.hob-order-orb.is-open ~ .hob-order-orb__dismiss,
.hob-order-orb-wrap.is-open .hob-order-orb__dismiss {
  opacity: 1;
  transform: scale(1);
}

.hob-order-orb__dismiss:hover,
.hob-order-orb__dismiss:focus-visible {
  background: #fff;
  outline: none;
  color: #1f6b5e;
}

@keyframes hob-orb-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hob-orb-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes hob-orb-ring {
  0% {
    transform: translateY(-50%) scale(1);
    opacity: 0.55;
  }
  70% {
    transform: translateY(-50%) scale(1.55);
    opacity: 0;
  }
  100% {
    transform: translateY(-50%) scale(1.55);
    opacity: 0;
  }
}

@keyframes hob-orb-steam {
  0%, 100% {
    opacity: 0.15;
    transform: translateY(2px) scaleY(0.7);
  }
  45% {
    opacity: 0.75;
    transform: translateY(-6px) scaleY(1);
  }
}

@media (max-width: 720px) {
  .hob-order-orb-wrap {
    /* Clear WhatsApp on the left; stay readable above home indicator */
    right: max(14px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
  }

  /* On touch, keep label peekable briefly via .is-open from JS */
  .hob-order-orb.is-open .hob-order-orb__label {
    max-width: 140px;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hob-order-orb-wrap,
  .hob-order-orb__core,
  .hob-order-orb__ring,
  .hob-order-orb__steam i {
    animation: none !important;
  }

  .hob-order-orb__core,
  .hob-order-orb__label,
  .hob-order-orb__dismiss {
    transition: none !important;
  }

  /* Still show a clear static CTA — label visible by default */
  .hob-order-orb__core {
    padding-right: 18px;
    gap: 2px;
  }

  .hob-order-orb__label {
    max-width: 140px;
    opacity: 1;
  }

  .hob-order-orb__ring {
    opacity: 0;
  }

  .hob-order-orb__dismiss {
    opacity: 1;
    transform: scale(1);
  }
}
