/* Back-to-top + chat buttons on the product landing pages (resources/views/landing/partials/widgets.blade.php).
   Mirrors the main site's widgets; every class is prefixed kbw- so it can't clash with a landing design. */
.kbw { --kbw-primary: #2563eb; --kbw-primary-deep: #1d4ed8; --kbw-primary-soft: #dbeafe; font-family: inherit; }
.kbw [hidden] { display: none !important; }

.kbw-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 95;
  width: 44px; height: 44px; border: 0; border-radius: 9999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--kbw-primary); color: #fff;
  box-shadow: 0 10px 15px -3px color-mix(in srgb, var(--kbw-primary) 30%, transparent), 0 4px 6px -4px color-mix(in srgb, var(--kbw-primary) 30%, transparent);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .3s, transform .3s, background-color .3s;
}
.kbw-top.kbw-visible { opacity: 1; transform: none; pointer-events: auto; }
.kbw-top.kbw-visible:hover { background: var(--kbw-primary-deep); transform: translateY(-4px); }
.kbw-top.kbw-stacked { bottom: 96px; }
@media (min-width: 640px) { .kbw-top.kbw-stacked-sm { bottom: 96px; } }

.kbw-chat { position: fixed; bottom: 24px; z-index: 95; display: flex; flex-direction: column; gap: 12px; }
.kbw-chat.kbw-right { right: 24px; align-items: flex-end; }
.kbw-chat.kbw-left { left: 24px; align-items: flex-start; }
@media (max-width: 639.98px) { .kbw-chat.kbw-desktop-only { display: none; } }

.kbw-fab {
  width: 56px; height: 56px; border: 0; border-radius: 9999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none;
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, .18), 0 4px 6px -4px rgba(15, 23, 42, .18);
  transition: transform .3s, background-color .3s;
}
.kbw-fab:hover { transform: translateY(-4px); }
.kbw-main { background: var(--kbw-primary); box-shadow: 0 10px 15px -3px color-mix(in srgb, var(--kbw-primary) 30%, transparent); }
.kbw-main:hover { background: var(--kbw-primary-deep); }
.kbw-whatsapp { background: #25d366; }
.kbw-whatsapp:hover { background: #1ebe5a; }
.kbw-messenger { background: linear-gradient(135deg, #00b2ff, #006aff); }

.kbw-icon-sm { width: 20px; height: 20px; }
.kbw-icon-md { width: 22px; height: 22px; }
.kbw-icon-lg { width: 28px; height: 28px; }

.kbw-panel {
  width: calc(100vw - 3rem); max-width: 20rem; overflow: hidden;
  background: #fff; border: 1px solid #e5eaf2; border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, .18);
  animation: kbw-up .4s cubic-bezier(.16, 1, .3, 1) both;
}
.kbw-panel-head { background: var(--kbw-primary); color: #fff; padding: 16px 20px; }
.kbw-panel-title { margin: 0; font-weight: 600; font-size: 16px; line-height: 1.4; }
.kbw-panel-text { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: var(--kbw-primary-soft); }
.kbw-panel-list { list-style: none; margin: 0; padding: 12px; display: grid; gap: 8px; }
.kbw-channel {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: #101828; font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color .2s;
}
.kbw-channel:hover { background: #f8fafc; }
.kbw-channel-icon { width: 40px; height: 40px; flex: none; border-radius: 9999px; color: #fff; display: flex; align-items: center; justify-content: center; }

@keyframes kbw-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .kbw-top, .kbw-fab, .kbw-panel { transition: none; animation: none; }
}

/* Phones: smaller buttons tucked closer to the corner, so they cover less of the page. */
@media (max-width: 639.98px) {
  .kbw-top { right: 16px; bottom: 16px; width: 40px; height: 40px; }
  .kbw-top.kbw-stacked { bottom: 76px; right: 20px; }
  .kbw-chat { bottom: 16px; }
  .kbw-chat.kbw-right { right: 16px; }
  .kbw-chat.kbw-left { left: 16px; }
  .kbw-fab { width: 48px; height: 48px; }
  .kbw-icon-lg { width: 24px; height: 24px; }
}

/* Brochure download links (public/landing/shared/brochure-link.js): the PDF is being built. */
a.kbb-loading {
    cursor: progress;
    opacity: .7;
    pointer-events: none;
}

/* Spinner after the link text. Landing pages may already use .btn::after for a decoration
   (e.g. the School page's absolutely positioned "shine"), so every layout property it could set
   is reset here; otherwise the spinner ends up stretched or pinned to a corner. */
a.kbb-loading::after {
    content: "";
    position: static;
    inset: auto;
    z-index: auto;
    flex: none;
    background: none;
    box-shadow: none;
    opacity: 1;
    transform: none;
    transition: none;
    display: inline-block;
    width: .9em;
    height: .9em;
    margin-left: .45em;
    vertical-align: -.1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: kbb-spin .7s linear infinite;
}

@keyframes kbb-spin {
    to { transform: rotate(360deg); }
}

/* Hidden page the PDF is built from; it needs a real size to lay the brochure out. */
.kbb-frame {
    position: fixed;
    top: 0;
    left: -20000px;
    width: 1400px;
    height: 1000px;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
