/**
 * Floating Sticky Booking Pop-up Styles
 * Matching demo-harucraft:
 * - Floating circular button (.oja-chat-circle)
 * - Sticky card (.booking-popup-card) anchored directly above the button
 * - Clean craft aesthetic, no full-screen modal backdrop
 */

/* ==========================================================================
   1. FLOATING CONTAINER (Bottom-Right Anchor)
   ========================================================================== */
.floating-chat-wrap,
.haru-floating-chat-wrap {
  position: fixed;
  bottom: 55px;
  right: 2px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
  /* clicks pass through empty areas */
}

/* ==========================================================================
   2. STICKY BOOKING CARD (.booking-popup-card)
   ========================================================================== */
.booking-popup-card,
.haru-booking-card {
  width: 360px;
  max-width: calc(100vw - 36px);
  background: #ffffff;
  border: 1px solid #ebe7e0;
  padding: 20px 20px 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  display: none;
  pointer-events: auto;
  border-radius: 2px;
  box-sizing: border-box;
  transform-origin: bottom right;
}

.booking-popup-card.open,
.haru-booking-card.open {
  display: flex;
  flex-direction: column;
  animation: haruCardSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes haruCardSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Card Header */
.booking-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #ebe7e0;
  margin-bottom: 14px;
}

.booking-popup-title {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111111;
  font-weight: 700;
  line-height: 1.2;
}

.booking-popup-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #777777;
  line-height: 1;
  padding: 0 4px;
  margin: 0;
  transition: color 0.15s ease, transform 0.15s ease;
  outline: none;
}

.booking-popup-close:hover {
  color: #111111;
  transform: scale(1.1);
}

/* Card Body (holds [block id="book-a-workshop"]) */
.booking-popup-body,
.haru-booking-popup-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: clamp(260px, 65vh, 520px);
  box-sizing: border-box;
  padding-right: 4px;
}

/* Custom Scrollbar for Card Body */
.booking-popup-body::-webkit-scrollbar {
  width: 5px;
}

.booking-popup-body::-webkit-scrollbar-track {
  background: transparent;
}

.booking-popup-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 3px;
}

.booking-popup-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.32);
}

/* Layout resets for inner UX block */
.booking-popup-body .row {
  margin-left: 0;
  margin-right: 0;
}

.booking-popup-body .col {
  padding-left: 6px;
  padding-right: 6px;
}

/* ==========================================================================
   3. FLOATING ACTION CIRCLE BUTTON (.oja-chat-circle)
   ========================================================================== */
.oja-chat-circle,
.haru-chat-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #111111;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.2s ease,
    background-color 0.2s ease;
  pointer-events: auto;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.oja-chat-circle:hover,
.haru-chat-circle:hover {
  transform: scale(1.02);
  background: #000000;
}

.oja-chat-circle:active,
.haru-chat-circle:active {
  transform: scale(0.95);
}

.oja-chat-circle svg,
.haru-chat-circle svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
  display: block;
}

/* ==========================================================================
   4. RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 767px) {

  .floating-chat-wrap,
  .haru-floating-chat-wrap {
    bottom: 20px;
    right: 16px;
    gap: 10px;
  }

  .oja-chat-circle,
  .haru-chat-circle {
    width: 48px;
    height: 48px;
    left: 15px;
  }

  .oja-chat-circle svg,
  .haru-chat-circle svg {
    width: 20px;
    height: 20px;
  }

  .booking-popup-card,
  .haru-booking-card {
    width: calc(100vw - 32px);
    padding: 16px 16px 14px;
  }

  .booking-popup-body,
  .haru-booking-popup-body {
    max-height: calc(100vh - 160px);
  }
}