/* SD Multistep — Frontend styles
   All selectors are prefixed .sd- to avoid conflicts with Salient / WPBakery */

/* ── OVERLAY ── */
.sd-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999998;
}

.sd-popup-overlay--no-blur {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sd-popup-overlay--hidden {
  display: none !important;
}

/* ── POPUP CONTAINER ── */
.sd-popup {
  --sd-tx: 0px; /* used by animations to preserve translateX for centered variant */
  display: none;
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  overflow: hidden;
  z-index: 999999;
  font-family: inherit;
}

/* Show state — triggers slide-up animation */
.sd-popup--visible {
  animation: sd-slideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Hide state — quick fade + slide down */
.sd-popup--hiding {
  animation: sd-slideDown 0.25s ease forwards;
}

@keyframes sd-slideUp {
  from {
    opacity: 0;
    transform: translateX(var(--sd-tx)) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(var(--sd-tx)) translateY(0);
  }
}

@keyframes sd-slideDown {
  from {
    opacity: 1;
    transform: translateX(var(--sd-tx)) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(var(--sd-tx)) translateY(10px);
  }
}

/* ── MOBILE: full width, override any theme width injection ── */
@media (max-width: 767px) {
  .sd-popup {
    width: auto !important;
    max-width: none !important;
    left: 16px !important;
    right: 16px !important;
    bottom: 16px !important;
  }
}

/* ── DESKTOP POSITION VARIANTS ── */
@media (min-width: 768px) {
  /* shared desktop base */
  .sd-popup--bottom-right,
  .sd-popup--bottom-left,
  .sd-popup--bottom-center {
    bottom: 20px;
    width: 380px !important;
    max-width: 380px !important;
    left: auto !important;
    right: auto !important;
  }

  .sd-popup--bottom-right {
    right: 20px !important;
  }

  .sd-popup--bottom-left {
    left: 20px !important;
  }

  .sd-popup--bottom-center {
    left: 50% !important;
    --sd-tx: -50%;
  }
}

/* ── CLOSE BUTTON ── */
.sd-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f1f3f5;
  color: #adb5bd;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  z-index: 2;
  padding: 0;
}
.sd-popup-close:hover {
  background: #e9ecef;
  color: #343a40;
}

/* ── INNER PADDING ── */
.sd-popup-inner {
  padding: 18px 18px 16px;
  width: 100%;
  box-sizing: border-box;
}

/* ── INSTRUCTOR ROW ── */
.sd-instructor {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.sd-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  position: relative;
}

/* Online dot via pseudo-element */
.sd-avatar::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #25D366;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.sd-instructor-info {
  flex: 1;
  min-width: 0;
}

.sd-instructor-name {
  font-size: 14px;
  font-weight: 600;
  color: #212529;
  line-height: 1.2;
}

.sd-instructor-status {
  font-size: 12px;
  color: #25D366;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* Pulse animation on status dot SVG */
.sd-instructor-status svg {
  animation: sd-pulse 2s ease-in-out infinite;
}

@keyframes sd-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── STAT BADGE ── */
.sd-stat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

/* Standalone stat badge (outside bubble) */
.sd-stat-row--standalone {
  margin-top: 0;
  margin-bottom: 12px;
}

.sd-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(37, 211, 102, 0.08);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #1eba58;
}

.sd-stat-badge svg {
  flex-shrink: 0;
}

/* ── GOOGLE PLACES AUTOCOMPLETE ── */
/* Ensure the dropdown renders above the popup overlay */
.pac-container {
  z-index: 9999999 !important;
}

/* ── CTA BUTTONS ── */
.sd-ctas {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* WhatsApp button directly inside popup inner (no wrapper div) */
.sd-popup-inner > .sd-cta-whatsapp {
  margin-bottom: 4px;
}

.sd-cta-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  background: #25D366;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  line-height: 1;
}

.sd-cta-whatsapp:hover,
.sd-cta-whatsapp:focus-visible {
  background: #1eba58;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.25);
  color: #ffffff;
  text-decoration: none;
}

.sd-cta-whatsapp:active {
  transform: translateY(0);
}

.sd-cta-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  background: transparent;
  color: #868e96;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  line-height: 1;
}

.sd-cta-call:hover,
.sd-cta-call:focus-visible {
  border-color: #ced4da;
  color: #343a40;
  background: #f8f9fa;
  text-decoration: none;
}

/* ── PRIVACY LINE ── */
.sd-privacy {
  text-align: center;
  margin-top: 10px;
  font-size: 11px;
  color: #868e96;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.4;
}

/* ── EMBEDDED FORM ── */

/* Wider popup on desktop when a CF7 form is embedded */
@media (min-width: 768px) {
  .sd-popup--with-form.sd-popup--bottom-right,
  .sd-popup--with-form.sd-popup--bottom-left,
  .sd-popup--with-form.sd-popup--bottom-center {
    width: 460px !important;
    max-width: 460px !important;
  }
}

/* Form title */
.sd-popup-form-title {
  font-size: 15px;
  font-weight: 600;
  color: #212529;
  margin: 0 0 10px;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .sd-popup-form-title {
    font-size: 16px;
  }
}

/* Allow taller popup to accommodate the form */
.sd-popup--with-form {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #dee2e6 transparent;
}

.sd-popup-form {
  margin-bottom: 4px;
}

/* ── "of" DIVIDER ── */

.sd-popup-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  color: #adb5bd;
  font-size: 12px;
  font-weight: 500;
}

.sd-popup-divider::before,
.sd-popup-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e9ecef;
}

/* ── WHATSAPP AS SECONDARY (when form is also shown) ── */

.sd-cta-whatsapp--secondary {
  padding: 10px 16px;
  font-size: 13.5px;
  background: #f6fef9;
  color: #1eba58;
  border: 1.5px solid #b9f0cd;
}

.sd-cta-whatsapp--secondary:hover,
.sd-cta-whatsapp--secondary:focus-visible {
  background: #edfbf3;
  border-color: #86e6b0;
  color: #1eba58;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.15);
}

/* ── MULTISTEP FORM INSIDE POPUP — light-background overrides ── */
/* The multistep CSS assumes a dark background (Salient theme).
   These overrides make inactive circles and lines visible on white. */

.sd-popup .sd-multistep {
  --sd-line-bg: #e9ecef;
  --sd-circle-border: #ced4da;
  --sd-circle-text: #868e96;
}

/* Back button: swap dark-border assumption for visible light-theme border */
.sd-popup .sd-multistep .sd-btn-group .sd-btn-back {
  border-color: #dee2e6 !important;
  color: #495057 !important;
  opacity: 1;
}

.sd-popup .sd-multistep .sd-btn-group .sd-btn-back:hover {
  opacity: 0.75;
  border-color: #adb5bd !important;
}

/* Tighten progress bar spacing inside popup */
.sd-popup .sd-multistep .sd-progress {
  margin-bottom: 14px !important;
}

/* ── INPUT FIELD OVERRIDES (fight Salient's large field styles) ──────────── */

.sd-popup .sd-multistep input[type="text"],
.sd-popup .sd-multistep input[type="email"],
.sd-popup .sd-multistep input[type="tel"],
.sd-popup .sd-multistep input[type="number"],
.sd-popup .sd-multistep input[type="url"],
.sd-popup .sd-multistep input[type="search"],
.sd-popup .sd-multistep input[type="date"],
.sd-popup .sd-multistep textarea,
.sd-popup .sd-multistep select {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 11px 14px !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.4 !important;
  font-size: 14px !important;
  font-family: inherit !important;
  color: #212529 !important;
  background: #f8f9fa !important;
  border: 1.5px solid #dee2e6 !important;
  border-radius: 10px !important;
  outline: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  transition: border-color 0.15s ease, background 0.15s ease !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.sd-popup .sd-multistep input[type="text"]:focus,
.sd-popup .sd-multistep input[type="email"]:focus,
.sd-popup .sd-multistep input[type="tel"]:focus,
.sd-popup .sd-multistep input[type="number"]:focus,
.sd-popup .sd-multistep input[type="url"]:focus,
.sd-popup .sd-multistep textarea:focus,
.sd-popup .sd-multistep select:focus {
  border-color: var(--sd-accent, #00b8d9) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(0, 184, 217, 0.1) !important;
}

.sd-popup .sd-multistep input::placeholder,
.sd-popup .sd-multistep textarea::placeholder {
  color: #adb5bd !important;
  opacity: 1 !important;
}

/* Kill any Salient wrappers / pseudo-elements on inputs inside popup */
.sd-popup .sd-multistep .wpcf7-form-control-wrap::before,
.sd-popup .sd-multistep .wpcf7-form-control-wrap::after,
.sd-popup .sd-multistep p::before,
.sd-popup .sd-multistep p::after {
  display: none !important;
}

/* Tight paragraph wrappers from CF7 inside popup */
.sd-popup .sd-multistep fieldset.sd-step > p {
  margin: 0 0 8px !important;
  padding: 0 !important;
}

.sd-popup .sd-multistep fieldset.sd-step > p:last-child {
  margin-bottom: 0 !important;
}

/* Kill empty paragraphs (blank lines in CF7 template become <p><br></p>) */
.sd-popup .sd-multistep fieldset.sd-step > p:empty,
.sd-popup .sd-multistep fieldset.sd-step > br {
  display: none !important;
}

/* Kill the <p> wrapping the hidden submit button — it still eats space */
.sd-popup .sd-multistep fieldset.sd-step > p:last-of-type:has(input[type="submit"]),
.sd-popup .sd-multistep fieldset.sd-step > p:last-of-type:has(.wpcf7-submit) {
  display: none !important;
  margin: 0 !important;
}

.sd-popup .sd-multistep fieldset.sd-step .wpcf7-form-control-wrap {
  display: block !important;
  margin-bottom: 0 !important;
}

/* Textarea: limit height inside popup */
.sd-popup .sd-multistep textarea {
  min-height: 80px !important;
  resize: vertical !important;
}

/* ── AVATAR IMAGE ── */
.sd-avatar--image {
  background: #f1f3f5 !important;
  overflow: hidden;
}

.sd-avatar--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ── URGENCY TIMER ── */
.sd-urgency-timer {
  background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
  border-radius: 10px;
  padding: 12px 14px 10px;
  margin-bottom: 10px;
  text-align: center;
}

.sd-timer-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.sd-timer-display {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}

.sd-timer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}

.sd-timer-num {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.02em;
}

.sd-timer-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.sd-timer-sep {
  font-size: 22px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1;
  padding-top: 1px;
}

.sd-timer-expired {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

/* ==========================================================================
   Floating WhatsApp FAB
   ========================================================================== */

.sd-fab {
  display: none;
  position: fixed;
  z-index: 999997;
  border-radius: 50%;
  border: none;
  background: #25d366;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

/* ── Sizes ── */
.sd-fab--s { width: 48px; height: 48px; }
.sd-fab--s svg { width: 22px; height: 22px; }
.sd-fab--m { width: 60px; height: 60px; }
.sd-fab--m svg { width: 28px; height: 28px; }
.sd-fab--l { width: 72px; height: 72px; }
.sd-fab--l svg { width: 34px; height: 34px; }
.sd-fab--xl { width: 88px; height: 88px; }
.sd-fab--xl svg { width: 42px; height: 42px; }

/* ── Desktop positions ── */
.sd-fab--desk-bottom-right { bottom: 24px; right: 24px; }
.sd-fab--desk-bottom-left  { bottom: 24px; left: 24px; }

/* ── Visible state ── */
.sd-fab--visible {
  display: flex;
  animation: sd-fabIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sd-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.sd-fab:active {
  transform: scale(0.95);
}

@keyframes sd-fabIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Shine animation ── */
.sd-fab-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 70%,
    transparent 100%
  );
  animation: sd-shine 3s ease-in-out infinite;
  pointer-events: none;
  border-radius: 50%;
}

@keyframes sd-shine {
  0%   { left: -100%; }
  40%  { left: 100%; }
  100% { left: 100%; }
}

/* ── Mobile positions ── */
@media (max-width: 767px) {
  .sd-fab--desk-bottom-right,
  .sd-fab--desk-bottom-left { bottom: auto; left: auto; right: auto; }
  .sd-fab--mob-bottom-right { bottom: 16px; right: 16px; }
  .sd-fab--mob-bottom-left  { bottom: 16px; left: 16px; }

  .sd-fab--s { width: 44px; height: 44px; }
  .sd-fab--s svg { width: 20px; height: 20px; }
  .sd-fab--m { width: 56px; height: 56px; }
  .sd-fab--m svg { width: 26px; height: 26px; }
  .sd-fab--l { width: 66px; height: 66px; }
  .sd-fab--l svg { width: 32px; height: 32px; }
  .sd-fab--xl { width: 78px; height: 78px; }
  .sd-fab--xl svg { width: 38px; height: 38px; }
}
