/*!
 * PrintLocker — site-wide extras, on every page
 * Markup: footer.php · Needs base.css
 *
 * 1. Floating buttons: back to top, call, email, WhatsApp
 * 2. Offer popup + teaser
 * 3. Our templates only (.pl-fullwidth): GeneratePress search modal
 */

/* ==========================================================================
   1. Floating buttons — bottom right; the label slides out on hover.
      Back to top sits above call and shows once the page is scrolled (header.js adds .is-visible)
   ========================================================================== */
.pl-float {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pl-float__btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease, visibility .2s;
}

.pl-float__btn svg {
  width: 22px;
  height: 22px;
}

.pl-float__btn--call { background: var(--blue); }
.pl-float__btn--mail { background: var(--pink); }
.pl-float__btn--whatsapp { background: #25d366; }

/* Back to top — a <button>, so reset the browser/theme button look. Two classes so theme button:hover colours don't win */
.pl-float .pl-float__btn--top {
  padding: 0;
  border: 0;
  background: var(--ink);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.pl-float .pl-float__btn--top:not(.is-visible) {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
}

.pl-float__btn:hover,
.pl-float__btn:focus,
.pl-float__btn:active {
  color: #fff;
}

.pl-float__btn:hover,
.pl-float__btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
}

.pl-float__label {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(6px, -50%);
  transition: opacity .15s ease, transform .15s ease;
}

.pl-float__btn:hover .pl-float__label,
.pl-float__btn:focus-visible .pl-float__label {
  opacity: 1;
  transform: translate(0, -50%);
}

@media (max-width: 640px) {
  .pl-float { right: 14px; bottom: 16px; gap: 8px; }
  .pl-float__btn { width: 44px; height: 44px; }
  .pl-float__btn svg { width: 20px; height: 20px; }
}

/* ==========================================================================
   2. Offer popup + teaser — the teaser (bottom left) shows after the first scroll,
      clicking it opens the popup
   ========================================================================== */
.overflow-hidden { overflow: hidden; }

.popup-fade { opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility .6s ease; }
.popup-fade.show { opacity: 1; visibility: visible; }

#popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background-color: rgba(0, 0, 0, .6);
}

#custom-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9999;
  width: 85%;
  max-width: 700px;
  padding: 10px;
  border-radius: 5px;
  background: #fff;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, .3);
  transform: translate(-50%, -50%);
}

#custom-popup img { display: block; width: 100%; max-width: 100%; height: auto; }
#custom-popup #popup-close { position: absolute; top: -16px; right: -18px; cursor: pointer; }

.offer-trigger {
  display: none;
  position: fixed;
  left: 5px;
  bottom: 5px;
  z-index: 999;
  width: 130px;
  height: 130px;
  background: transparent;
  color: #fff;
  text-align: center;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: all .3s;
}
.offer-trigger .circle-element { transition: all .3s; }
.offer-trigger .offer-word { position: absolute; top: -65px; left: 25px; width: 70px; transform: rotate(-10deg); }
.offer-trigger .offer-arrow { position: absolute; top: -25px; right: -15px; width: 55px; transform: rotate(75deg); }

@media (max-width: 1024px) {
  .offer-trigger { width: 100px; height: 100px; }
  .offer-trigger .offer-word { top: -65px; left: 15px; width: 50px; }
  .offer-trigger .offer-arrow { right: -12px; width: 50px; }
}
@media (max-width: 768px) {
  .offer-trigger { width: 65px; height: 65px; }
  .offer-trigger .offer-word { top: -35px; left: 7px; width: 35px; }
  .offer-trigger .offer-arrow { top: -18px; right: -5px; width: 30px; z-index: -1; }
}

/* ==========================================================================
   3. Our templates only — GeneratePress search modal (our header has its own search; these pages
      don't load GeneratePress's CSS, which would otherwise keep it hidden)
   ========================================================================== */

.pl-fullwidth .gp-search-modal { display: none; }
