/* =========================================================
   WA Lead Pro v2.1 — Frontend Styles
   ========================================================= */

/* ----- CSS Custom Properties (dari walp_label_css()) ----- */
:root {
  --wasf-label-size:   13px;
  --wasf-label-weight: 600;
  --wasf-label-pt:     0px;
  --wasf-label-pb:     4px;
}

/* =========================================================
   Floating Action Button
   ========================================================= */
#wasf-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  /* When no label: perfect circle via width/height set by JS */
  /* When label present: auto width, pill shape */
  min-width: 56px;
  height: 56px;
  background: #25d366;
  border: none;
  border-radius: 9999px; /* pill default, overridden by shape class */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  z-index: 9900;
  box-shadow: 0 4px 16px rgba(0,0,0,.28);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  padding: 0 18px;
  white-space: nowrap;
  /* Pulse ring */
  isolation: isolate;
  box-sizing: border-box;
}

/* No label: remove horizontal padding so it stays a perfect circle */
#wasf-fab:not([data-has-label]) {
  padding: 0;
}

/* With label: auto width expands to fit icon + text */
#wasf-fab[data-has-label] {
  width: auto !important;
  padding: 0 20px 0 16px;
  gap: 10px;
}

#wasf-fab:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 22px rgba(0,0,0,.36);
}

/* Shape variants */
#wasf-fab.wasf-round  { border-radius: 9999px; }
#wasf-fab.wasf-square { border-radius: 14px !important; }

/* Label text style */
#wasf-fab .wasf-btn-label {
  color: inherit; /* inherits from setupFab iconColor logic */
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Position variants */
#wasf-fab.wasf-left { right: auto; left: 24px; }

/* Sembunyikan FAB saat modal terbuka */
body.wasf-modal-open #wasf-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

/* Label text — see also #wasf-fab .wasf-btn-label above */
.wasf-btn-label {
  font-family: inherit; /* follows page font */
}

/* Icon — fill proportionally using CSS, not just attribute */
#wasf-fab svg {
  flex-shrink: 0;
  display: block;
  overflow: visible;
  /* Critical: prevent theme 'height:auto' from collapsing icon on mobile */
  height: 55% !important;
  width: 55% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

/* Icon fills 55% of button - works on all devices */
#wasf-fab:not([data-has-label]) svg,
#wasf-fab:not([data-has-label]) svg:not([width]) {
  width: 55% !important;
  height: 55% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  /* Reset any theme height:auto that breaks mobile */
  aspect-ratio: 1 / 1;
}

/* Force on mobile - beats theme overrides */
@media (max-width: 768px) {
  #wasf-fab svg {
    width: 55% !important;
    height: 55% !important;
    max-width: none !important;
    max-height: none !important;
  }
}

/* Pulse animation */
#wasf-fab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #25d366;
  opacity: 0;
  z-index: -1;
  animation: wasf-pulse 2.8s ease-out infinite;
}

@keyframes wasf-pulse {
  0%   { transform: scale(1);   opacity: .45; }
  70%  { transform: scale(1.5); opacity: 0;   }
  100% { opacity: 0; }
}

/* =========================================================
   Greeting Bubble
   ========================================================= */
#wasf-greeting {
  position: fixed;
  bottom: 90px;
  right: 92px;
  background: #fff;
  border-radius: 14px 14px 0 14px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: system-ui, -apple-system, sans-serif;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  z-index: 9899;
  max-width: 220px;
  line-height: 1.45;
  animation: wasf-pop .3s ease;
}

#wasf-greeting.wasf-left {
  right: auto;
  left: 92px;
  border-radius: 14px 14px 14px 0;
}

@keyframes wasf-pop {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Note Below Button
   ========================================================= */
.wasf-btn-note {
  position: fixed;
  bottom: 90px;
  right: 28px;
  font-size: 12px;
  color: #555;
  background: rgba(255,255,255,.9);
  border-radius: 6px;
  padding: 3px 9px;
  z-index: 9898;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 6px rgba(0,0,0,.1);
  margin: 0;
  transition: opacity .2s;
}

.wasf-btn-note.wasf-left {
  right: auto;
  left: 28px;
}

/* Sembunyikan note saat modal terbuka */
body.wasf-modal-open .wasf-btn-note {
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   Modal Backdrop
   ========================================================= */
#wasf-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9950;
  animation: wasf-fade-in .2s ease;
}

#wasf-backdrop[hidden] { display: none; }

@keyframes wasf-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =========================================================
   Modal
   ========================================================= */
#wasf-modal {
  position: fixed;
  z-index: 9960;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 18px;
  box-sizing: border-box;
  width: min(460px, 94vw);
  max-width: 100vw;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 26px 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  font-family: system-ui, -apple-system, sans-serif;
  animation: wasf-modal-in .25s cubic-bezier(.34,1.4,.64,1);
  overscroll-behavior: contain;
}

#wasf-modal[hidden] { display: none; }

@keyframes wasf-modal-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 20px)) scale(.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Modal header */
.wasf-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  /* justify-content ensures close button stays right even when title is empty */
  justify-content: space-between;
}

.wasf-modal-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: #111;
  margin: 0;
  line-height: 1.3;
}

#wasf-modal .wasf-modal-title,
.wasf-embed-wrap .wasf-embed-title {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  text-indent: 0 !important;
}

.wasf-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #bbb;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}

.wasf-modal-close:hover { color: #333; background: #f0f0f0; }
/* Success popup × sits reliably in the top-right corner, above all content. */
#wasf-modal .wasf-success-close,
.wasf-modal-overlay .wasf-success-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  font-size: 24px;
  line-height: 1;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================
   Form Fields Layout
   ========================================================= */
.wasf-fields-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
}

/* Full width = 100%, Half = ~50% */
.wasf-field {
  width: 100%;
  margin-bottom: 14px;
  box-sizing: border-box;
}

.wasf-field-half {
  width: calc(50% - 6px);
}

/* Label */
.wasf-label {
  display: block;
  font-size: var(--wasf-label-size);
  font-weight: var(--wasf-label-weight);
  color: #333;
  padding-top: var(--wasf-label-pt);
  padding-bottom: var(--wasf-label-pb);
  line-height: 1.4;
}

/* Input / Select / Textarea — unified rounded style */
.wasf-input,
.wasf-select,
.wasf-textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;   /* same rounded corner for ALL field types */
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  background: #fafafa;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;     /* normalize date/select across browsers */
}

/* Date input: keep native picker but uniform style */
.wasf-input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
}

.wasf-input:focus,
.wasf-select:focus,
.wasf-textarea:focus {
  border-color: #25d366;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,211,102,.12);
}

.wasf-input.wasf-error,
.wasf-select.wasf-error,
.wasf-textarea.wasf-error {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229,62,62,.1);
}

/* Error message */
.wasf-error-msg {
  display: block;
  font-size: 11px;
  color: #e53e3e;
  margin-top: 3px;
  min-height: 16px;
}

.wasf-textarea {
  resize: vertical;
  min-height: 72px;
}

.wasf-select {
  cursor: pointer;
  /* Custom dropdown arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  /* Force same height as text inputs — browsers shrink select by default */
  height: auto;
  min-height: 46px;       /* matches padding:10px*2 + font:14px * line-height:1.4 */
  line-height: 1.4;       /* same as text inputs */
  vertical-align: middle; /* center text vertically */
}

/* Extra reset for WebKit/Safari mobile which ignore padding on <select> */
@supports (-webkit-appearance: none) {
  .wasf-select {
    -webkit-appearance: none;
    padding-top: 10px;
    padding-bottom: 10px;
    line-height: 1.4;
  }
}

/* Submit button */
.wasf-submit-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 6px;
  transition: filter .2s, transform .15s;
}

.wasf-submit-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.wasf-submit-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.wasf-submit-btn svg { flex-shrink: 0; }

/* Success state */
.wasf-success {
  text-align: center;
  padding: 16px 0 8px;
}

.wasf-success-icon { font-size: 52px; display: block; margin-bottom: 12px; }

/* =========================================================
   Embedded Form (shortcode)
   ========================================================= */
.wasf-embed-wrap {
  font-family: system-ui, -apple-system, sans-serif;
}

.wasf-embed-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 18px;
  color: #111;
}

.wasf-embed-form .wasf-fields-wrap {
  gap: 0 12px;
}

/* =========================================================
   Mobile — sheet dari bawah, half tetap 2 kolom
   ========================================================= */
@media (max-width: 520px) {
  #wasf-modal {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 24px 18px 28px;
    animation: wasf-sheet-up .28s cubic-bezier(.34,1.3,.64,1);
  }

  @keyframes wasf-sheet-up {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* half kolom TETAP 2 kolom di mobile */
  .wasf-field-half {
    width: calc(50% - 6px);
  }

  /* Sedikit perkecil input di mobile untuk muat */
  .wasf-input, .wasf-select, .wasf-textarea {
    font-size: 16px; /* prevent zoom on iOS */
    padding: 9px 10px;
  }

  .wasf-select {
    min-height: 44px;
    line-height: 1.4;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  #wasf-fab { bottom: 20px; right: 20px; }
  #wasf-fab.wasf-left { right: auto; left: 20px; }

  #wasf-greeting { right: 80px; }
  #wasf-greeting.wasf-left { right: auto; left: 80px; }
}

/* =========================================================
   Pre-Click Capture Popup (Floating Button mode)
   ========================================================= */
#wasf-capture-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.48);
  z-index: 9950;
  animation: wasf-fade-in .2s ease;
}
#wasf-capture-backdrop[hidden] { display: none; }

#wasf-capture-popup {
  position: fixed;
  z-index: 9960;
  bottom: 90px;
  right: 24px;
  width: min(320px, 90vw);
  background: #fff;
  border-radius: 16px;
  padding: 20px 20px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  font-family: system-ui, -apple-system, sans-serif;
  animation: wasf-pop .25s cubic-bezier(.34,1.4,.64,1);
}
#wasf-capture-popup[hidden] { display: none; }
#wasf-capture-popup.wasf-left { right: auto; left: 24px; }

@media (max-width:520px) {
  #wasf-capture-popup {
    bottom: 0; right: 0; left: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    animation: wasf-sheet-up .25s ease;
  }
  #wasf-capture-popup.wasf-left { left: 0; right: 0; }
}

.wasf-capture-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.wasf-capture-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: #111;
  margin: 0;
  line-height: 1.4;
}
.wasf-capture-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #bbb;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.wasf-capture-close:hover { color: #555; }

/* Fields inside capture popup */
#wasf-capture-popup .wasf-field { margin-bottom: 10px; }
#wasf-capture-popup .wasf-label { font-size: 12px; }
#wasf-capture-popup .wasf-input,
#wasf-capture-popup .wasf-select { padding: 8px 10px; font-size: 13px; }

/* Submit */
.wasf-capture-submit {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter .2s;
  margin-top: 4px;
}
.wasf-capture-submit:hover { filter: brightness(1.08); }

/* Skip link */
.wasf-capture-skip {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #888;
  margin-top: 8px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wasf-capture-skip:hover { color: #444; }

/* ========================================================
   v2.4 FIX: Font inherit from page for all widget elements
   ======================================================== */
#wasf-fab,
#wasf-fab *,
#wasf-modal,
#wasf-modal *,
.wasf-embed-wrap,
.wasf-embed-wrap *,
#wasf-capture-popup,
#wasf-capture-popup * {
  font-family: inherit;
}

/* Success popup share buttons + image */
.wasf-success-share { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.wasf-success-share .wasf-share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: #f4f6f8; color: #374151; border: 1px solid #e2e8f0;
  text-decoration: none; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.wasf-success-share .wasf-share-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.wasf-success-share .wasf-share-btn:hover { background: #eceff3; border-color: #cbd5e1; color: #1e293b; }
.wasf-success-share .wasf-share-btn.wasf-share-icon-only {
  padding: 10px; border-radius: 50%; min-width: 0;
}
.wasf-success-share .wasf-share-btn.wasf-share-icon-only.wasf-share-square {
  border-radius: 10px;
}
.wasf-success-share .wasf-share-btn.wasf-share-icon-only svg { width: 22px; height: 22px; }
.wasf-success img { display: block; margin: 6px auto 0; }
#wasf-success-overlay .wasf-modal { max-width: 420px; text-align: center; }

/* ------------------------------------------------------------------
 * Button-mode success overlay
 * ------------------------------------------------------------------
 * The form-mode shell uses ID selectors (#wasf-backdrop / #wasf-modal),
 * but the button-mode overlay is injected dynamically with class-only
 * markup so it doesn't collide with form-mode IDs. Without these rules
 * the overlay would render as an unstyled inline div (invisible).
 * The selectors are scoped to #wasf-success-overlay so they can never
 * leak into theme markup. */
#wasf-success-overlay .wasf-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9950;
  animation: wasf-fade-in .2s ease;
}
#wasf-success-overlay .wasf-modal-overlay {
  position: fixed;
  z-index: 9960;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 18px;
  box-sizing: border-box;
  width: min(420px, 94vw);
  max-width: 100vw;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 26px 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  font-family: system-ui, -apple-system, sans-serif;
  animation: wasf-modal-in .25s cubic-bezier(.34,1.4,.64,1);
  overscroll-behavior: contain;
}

/* Floating button custom icon */
.wasf-fab-custom-icon { width: 60%; height: 60%; object-fit: contain; display: block; }

/* Success popup close button — pinned top-right */
.wasf-modal { position: relative; }
.wasf-success-close {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1; color: #94a3b8;
  background: rgba(0,0,0,.04); border: none; border-radius: 8px; cursor: pointer;
  transition: color .15s, background .15s;
}
.wasf-success-close:hover { color: #1e293b; background: rgba(0,0,0,.08); }

/* ════════════════════════════════════════════════════════════════
 * Theme-proofing — keep the plugin's popup form fields tidy no matter
 * what the active theme injects. High-specificity + !important on the
 * box-model essentials only (visuals above remain easy to override by
 * our own rules). Scoped strictly to plugin containers.
 * ════════════════════════════════════════════════════════════════ */
#wasf-modal .wasf-input,
#wasf-modal .wasf-select,
#wasf-modal .wasf-textarea,
.wasf-embed-form .wasf-input,
.wasf-embed-form .wasf-select,
.wasf-embed-form .wasf-textarea {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  border-radius: 8px !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  float: none !important;
}
#wasf-modal .wasf-textarea,
.wasf-embed-form .wasf-textarea {
  min-height: 72px !important;
  height: auto !important;
}
#wasf-modal .wasf-select,
.wasf-embed-form .wasf-select {
  padding-right: 32px !important;
  background-color: #fafafa !important;
}
/* Field rows: ensure even spacing isn't collapsed by theme resets */
#wasf-modal .wasf-field,
.wasf-embed-form .wasf-field {
  width: 100% !important;
  margin: 0 0 14px 0 !important;
  padding: 0 !important;
}
#wasf-modal .wasf-fields-wrap,
.wasf-embed-form .wasf-fields-wrap {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0 12px !important;
}
#wasf-modal .wasf-field-half,
.wasf-embed-form .wasf-field-half {
  width: calc(50% - 6px) !important;
}
/* Submit button: stop themes from restyling width/transform */
#wasf-modal .wasf-submit-btn,
.wasf-embed-form .wasf-submit-btn {
  box-sizing: border-box !important;
  width: 100% !important;
  margin: 4px 0 0 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* ════════════════════════════════════════════════════════════════
 * Mobile: the popup form must never exceed the viewport width.
 * ════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  #wasf-modal {
    /* Anchor to viewport with fixed insets so it can never run off-screen,
       regardless of theme transforms on ancestors. */
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 22px 16px 18px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }
  /* Keep half/full layout working on mobile too; just contain widths. */
  #wasf-modal .wasf-input,
  #wasf-modal .wasf-select,
  #wasf-modal .wasf-textarea,
  #wasf-modal .wasf-submit-btn,
  #wasf-modal .wasf-modal-title,
  #wasf-modal .wasf-fields-wrap,
  #wasf-modal .wasf-field {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ================================================================
   Welcome Popup  (v2.9.17)
   ================================================================ */
#wasf-welcome-overlay {
  /* !important on position/z-index: this overlay is appended directly to
     <html>, outside any theme markup, but some themes/plugins apply broad
     mobile-only resets (e.g. "* { position: static !important }" inside a
     mobile media query, seen in a few page builders) that would otherwise
     break it. z-index raised well above typical mobile hamburger-menu
     drawers/overlays (commonly 9999–99999 in popular themes). */
  position: fixed !important; inset: 0; z-index: 999999 !important;
  display: flex; align-items: center; justify-content: center;
  /* Hidden by default; class .wasf-wp-open triggers transition */
  pointer-events: none; visibility: hidden;
}
#wasf-welcome-overlay.wasf-wp-open {
  pointer-events: auto; visibility: visible;
}

/* Backdrop — blurs the page, dims to focus on popup */
.wasf-wp-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .28s ease;
}
#wasf-welcome-overlay.wasf-wp-open .wasf-wp-backdrop { opacity: 1; }

/* Frame — positions the box + close button together; overflow stays
   VISIBLE here so the close button (placed outside the box edge) never
   gets clipped by the box's own internal scrollbar. Also owns the
   open/close transform+opacity transition. */
/* Frame — shrinks to fit the image; image determines width, not the
   other way around. Viewport-relative constraints stop it going off-screen.
   fit-content fallback ensures older browsers still work fine. */
.wasf-wp-frame {
  position: relative; z-index: 1;
  /* v2.11.35 — fixed width, not fit-content. fit-content sizes the frame to
     its content's INTRINSIC width; a wide/landscape source image reported an
     intrinsic width larger than the viewport, so the frame (and the overlay
     behind it) grew wider than the screen and caused horizontal scroll.
     A fixed width makes the frame the sizing authority instead of the
     image — the image is then capped to 100% of ITS parent (see
     .wasf-wp-img below), which can never exceed this fixed width. */
  width: min(88vw, 460px);
  max-width: min(88vw, 460px);
  box-sizing: border-box;
  margin: 0 auto; /* guarantee horizontal centering inside the flex overlay */
  transform: translateY(24px) scale(.97);
  opacity: 0;
  transition: transform .28s cubic-bezier(.22,1,.36,1), opacity .28s ease;
}
#wasf-welcome-overlay.wasf-wp-open .wasf-wp-frame {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.wasf-wp-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.32), 0 4px 16px rgba(0,0,0,.12);
  /* v2.11.29 — comfortable breathing room between the window edge and the
     image / text / button inside (was 14px 10px 10px, too cramped).
     v2.12.1 — !important added: a page-builder/theme reset that beats a
     plain inline box-sizing:border-box (see the matching inline hardening
     in script.js) was silently reintroducing the desktop padding bug even
     after the v2.11.36 border-box fix landed here. */
  padding: 20px 22px 22px !important;
  width: 100%;
  /* v2.11.36 — box-sizing was left at the UA default (content-box). With
     width:100% that means the 22px left/right padding was added ON TOP of
     the frame's fixed width (introduced in 2.11.35 to fix the horizontal-
     scroll bug), so the box overflowed its frame and visually ate its own
     padding at desktop sizes — title/body/button all sat flush against the
     popup's outer edge instead of being inset. border-box makes padding
     come out of the 100% instead of adding to it.
     v2.12.1 — !important added for the same reason as padding above. */
  box-sizing: border-box !important;
  max-height: 90vh; overflow-y: auto;
}

/* Text content follows directly, spaced by the box's own padding above. */

.wasf-wp-close {
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box; margin: 0; padding: 0;
  /* v2.11.30 — !important on the positional core: some themes apply broad
     position/button resets (occasionally !important, especially inside
     mobile media queries) that unseated the absolute positioning and dumped
     the button at the top-left. Mirrors the overlay's own defense. */
  position: absolute !important; top: -14px !important; right: -14px !important;
  left: auto !important; bottom: auto !important;
  background: #fff; border: 0; border-radius: 50%;
  width: 32px; height: 32px; flex-shrink: 0; cursor: pointer;
  font-size: 15px; font-family: inherit; line-height: 1; color: #dc2626; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.04);
  transition: transform .15s, box-shadow .15s;
  z-index: 2;
}
.wasf-wp-close:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(0,0,0,.28); color: #b91c1c; }

.wasf-wp-img {
  display: block;
  /* v2.11.35 — width:100% (not width:auto + a vw/px max-width) is what
     actually guarantees the image can never exceed its now fixed-width
     parent (.wasf-wp-frame/.wasf-wp-box), regardless of the source image's
     own pixel dimensions — this is what stopped the horizontal scroll. */
  width: 100%; height: auto;
  max-height: 78vh;
  object-fit: contain;
  margin: 0 auto 12px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.13);
}
a .wasf-wp-img:hover { transform: scale(1.01); }
.wasf-wp-img-only { margin-bottom: 0; }

/* Text */
.wasf-wp-title {
  font-size: 20px; font-weight: 700; line-height: 1.3;
  margin: 0 0 10px; color: #1a1a1a;
}
.wasf-wp-body {
  font-size: 14px; line-height: 1.6; color: #555;
  margin: 0 0 18px;
}

/* Button */
.wasf-wp-btn {
  display: block; width: 100%;
  background: #25d366; color: #fff;
  border: 0; border-radius: 10px;
  padding: 13px 20px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; text-align: center;
  transition: background .15s, transform .1s;
}
.wasf-wp-btn:hover { background: #1aaf52; }
.wasf-wp-btn:active { transform: scale(.99); }

/* body class added while popup is open — prevents scroll-jank */
body.wasf-welcome-open { overflow: hidden; }

/* Mobile */
@media (max-width: 480px) {
  /* v2.11.29 — comfortable padding on mobile too (was 12px 3px 3px).
     v2.12.1 — !important added to match the desktop hardening above. */
  .wasf-wp-box { padding: 16px 14px 16px !important; border-radius: 12px; }
  .wasf-wp-img { max-height: 62vh; border-radius: 6px; }
  .wasf-wp-title { font-size: 17px; }
  .wasf-wp-btn { font-size: 14px; padding: 12px 16px; }
}

/* ═══ Embed Button shortcode — v2.10.0 ═══ */
.wasf-eb-wrap { margin: 8px 0; }
.wasf-eb:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.wasf-eb:active { transform: translateY(0); filter: brightness(.96); }
.wasf-eb, .wasf-eb:focus { outline-offset: 2px; }

/* ── WooCommerce "Order via WhatsApp" button (v2.11.16) ─────────────
 * Background color, border radius & text color are inlined from the
 * Floating Button settings — no separate style system. */
.wasf-woo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  margin: 12px 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.wasf-woo-btn:hover,
.wasf-woo-btn:focus {
  filter: brightness(1.07);
  transform: translateY(-1px);
  color: inherit;
}
.wasf-woo-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

/* ── WhatsApp Store / Sales Flow (Pro, v2.11.17) ────────────────────
 * Popup storefront: product list → details + payment → order summary. */
html.wasf-store-lock { overflow: hidden; }
.wasf-store-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 24, 39, .55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.wasf-store-overlay[hidden] { display: none; }
.wasf-store-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: min(86vh, 640px);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 22px 20px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  font-size: 14px;
  line-height: 1.45;
  color: #111827;
}
.wasf-store-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.wasf-store-close:hover { background: #e5e7eb; }
.wasf-store-title { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.wasf-store-items { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.wasf-store-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.wasf-store-item:hover { border-color: #86efac; }
.wasf-store-item:has(input:checked) { border-color: #25d366; background: #f0fdf4; }
.wasf-store-item input { accent-color: #25d366; flex: 0 0 auto; margin: 0; }
.wasf-store-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.wasf-store-item-name { font-weight: 600; }
.wasf-store-item-desc { font-size: 12px; color: #6b7280; }
.wasf-store-item-price { flex: 0 0 auto; font-weight: 700; color: #15803d; white-space: nowrap; }
.wasf-store-next:not(:disabled),
.wasf-store-submit,
.wasf-store-confirm {
  background: #25d366 !important;
  color: #fff !important;
  border: 0 !important;
}
.wasf-store-next,
.wasf-store-submit,
.wasf-store-confirm {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  transition: filter .15s ease;
}
.wasf-store-next:hover,
.wasf-store-submit:hover,
.wasf-store-confirm:hover { filter: brightness(1.06); color: #fff; }
.wasf-store-next:disabled { background: #d1d5db; cursor: not-allowed; }
.wasf-store-back {
  border: 0;
  background: none;
  padding: 0 0 8px;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
}
.wasf-store-picked {
  margin: 0 0 12px;
  padding: 9px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
}
.wasf-store-inp {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 9px;
  padding: 11px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
}
.wasf-store-inp:focus { outline: none; border-color: #25d366; }
.wasf-store-paylabel { margin: 4px 0 6px; font-weight: 600; font-size: 13px; }
.wasf-store-pays { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.wasf-store-pay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.wasf-store-pay:has(input:checked) { border-color: #25d366; background: #f0fdf4; }
.wasf-store-pay input { accent-color: #25d366; margin: 0; }
.wasf-store-err {
  margin: 0 0 10px;
  padding: 9px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #b91c1c;
  font-size: 13px;
}
.wasf-store-invoice {
  margin: 0 0 12px;
  border: 1.5px dashed #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
}
.wasf-store-inv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
}
.wasf-store-inv-row span { color: #6b7280; }
.wasf-store-payinfo {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
}
.wasf-store-payinfo p { margin: 0 0 8px; }
.wasf-store-qris { max-width: 220px; width: 100%; height: auto; border-radius: 8px; }
.wasf-store-bank { display: flex; flex-direction: column; gap: 2px; }
.wasf-store-acct { font-size: 18px; font-weight: 800; letter-spacing: .04em; }
.wasf-store-hint { margin: 8px 0 0; font-size: 12px; color: #6b7280; text-align: center; }
.wasf-store-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
  transition: filter .15s ease, transform .15s ease;
}
.wasf-store-trigger:hover { filter: brightness(1.07); transform: translateY(-1px); }

/* ── WA Store: product image (4:3) in the item card (v2.11.18) ───── */
.wasf-store-item-imgwrap {
  flex: 0 0 auto;
  width: 64px;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
}
.wasf-store-item-imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── WA Store: inline product catalog — [wasf_store display="grid"] ─
 * v2.11.21: responsive columns (desktop/mobile via shortcode attrs),
 * soft shadows, hover lift + image zoom, search toolbar & pagination. */
.wasf-store-grid-wrap { margin: 18px 0; }
.wasf-store-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}
.wasf-store-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: 340px;
  color: #9ca3af;
}
.wasf-store-search-wrap svg { position: absolute; left: 12px; pointer-events: none; }
.wasf-store-search {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1.5px solid #e5e7eb;
  border-radius: 999px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.wasf-store-search:focus { outline: none; border-color: #25d366; }
.wasf-store-count { font-size: 13px; color: #6b7280; white-space: nowrap; }
.wasf-store-grid {
  display: grid;
  grid-template-columns: repeat(var(--wasf-store-cols, 3), minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 782px) {
  .wasf-store-grid { grid-template-columns: repeat(var(--wasf-store-cols-m, 2), minmax(0, 1fr)); gap: 14px; }
}
.wasf-store-gitem {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(17, 24, 39, .06);
  transition: box-shadow .18s ease, transform .18s ease;
}
.wasf-store-gitem:hover {
  box-shadow: 0 14px 34px rgba(17, 24, 39, .13);
  transform: translateY(-3px);
}
.wasf-store-gimg {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;               /* consistent 4:3 display */
  overflow: hidden;
  background: #f3f4f6;
}
.wasf-store-gimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.wasf-store-gitem:hover .wasf-store-gimg img { transform: scale(1.05); }
.wasf-store-gimg-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #d1d5db;
}
.wasf-store-gbody { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 4px; flex: 1 1 auto; }
.wasf-store-gname  { font-weight: 700; font-size: 15px; line-height: 1.3; color: #111827; }
.wasf-store-gdesc  { font-size: 13px; line-height: 1.45; color: #6b7280; }
.wasf-store-gfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px 14px;
}
.wasf-store-gprice {
  font-weight: 800;
  font-size: 14px;
  color: #15803d;
  background: #f0fdf4;
  border-radius: 999px;
  padding: 4px 10px;
}
.wasf-store-gorder {
  padding: 9px 20px;
  border: 0;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 211, 102, .35);
  transition: filter .15s ease, transform .15s ease;
}
.wasf-store-gorder:hover { filter: brightness(1.06); transform: translateY(-1px); }
.wasf-store-empty {
  margin: 14px 0;
  padding: 18px;
  text-align: center;
  color: #6b7280;
  background: #f8fafc;
  border: 1.5px dashed #e5e7eb;
  border-radius: 12px;
}
.wasf-store-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 0;
  flex-wrap: wrap;
}
.wasf-store-pbtn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.wasf-store-pbtn:hover:not(:disabled) { border-color: #25d366; }
.wasf-store-pbtn.is-active { background: #25d366; border-color: #25d366; color: #fff; }
.wasf-store-pbtn:disabled { opacity: .4; cursor: not-allowed; }
.wasf-store-pdots { color: #9ca3af; padding: 0 2px; }


/* ── WA Store v2.11.23: qty stepper, download QRIS, copy rekening, thanks ── */
.wasf-store-item-right { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wasf-store-qty { display: inline-flex; align-items: center; gap: 8px; background: #f3f4f6; border-radius: 999px; padding: 2px; }
.wasf-store-qbtn { width: 24px; height: 24px; border: 0; border-radius: 999px; background: #fff; color: #111827; font-size: 14px; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.wasf-store-qn { min-width: 16px; text-align: center; font-weight: 700; font-size: 13px; }
.wasf-store-qriswrap { position: relative; display: inline-block; }
.wasf-store-qrisdl { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 8px; background: rgba(17,24,39,.75); color: #fff !important; display: flex; align-items: center; justify-content: center; text-decoration: none !important; }
.wasf-store-qrisdl:hover { background: rgba(17,24,39,.9); }
.wasf-store-acctrow { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.wasf-store-copy { border: 0; background: #eef2ff; color: #4338ca; border-radius: 8px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.wasf-store-copy.is-copied { background: #dcfce7; color: #15803d; }
.wasf-store-thanks { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0 4px; }
.wasf-store-thanks-ico { font-size: 46px; line-height: 1; }
.wasf-store-thanks-sub { margin: 0; color: #6b7280; font-size: 13.5px; text-align: center; }
.wasf-store-share { display: flex; gap: 10px; margin: 8px 0 4px; }
.wasf-store-share-btn { width: 40px; height: 40px; border-radius: 999px; background: #f3f4f6; color: #111827 !important; display: flex; align-items: center; justify-content: center; text-decoration: none !important; transition: background .15s ease; }
.wasf-store-share-btn:hover { background: #e5e7eb; }
.wasf-store-share-btn svg { width: 18px; height: 18px; }
.wasf-store-thanks-close { margin-top: 6px; padding: 10px 28px; border: 0; border-radius: 999px; background: #111827; color: #fff; font-weight: 700; font-size: 13.5px; cursor: pointer; }
