/* Workflow Forms. Plain by default so the theme's own styles apply. The --wf-*
   variables come from the shop branding (one attribute-selector rule written by
   the script) and, for a block set to "Custom", from its own #wf-<block id> rule,
   which wins. An unset color falls back to the theme (inherit / currentColor). */
.workflow-form { max-width: var(--wf-max-width, 640px); color: var(--wf-text, inherit); }
.workflow-form--align-left { margin-inline: 0 auto; }
.workflow-form--align-center { margin-inline: auto; }
.workflow-form--align-right { margin-inline: auto 0; }
.wf-form { display: flex; flex-direction: column; gap: var(--wf-gap, 16px); }
.wf-field { display: flex; flex-direction: column; gap: 6px; }
.wf-field[hidden], .wf-error[hidden] { display: none; }
.wf-label { color: var(--wf-label, inherit); }
.wf-link { color: inherit; text-decoration: underline; }
.wf-content p { margin: 0 0 .5em; }
.wf-field input:not([type="checkbox"]):not([type="radio"]), .wf-field select, .wf-field textarea {
  width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px;
  color: var(--wf-input-text, inherit);
  background: var(--wf-input-bg, transparent);
  border: var(--wf-border-width, 1px) solid var(--wf-input-border, currentColor);
  border-radius: var(--wf-input-radius, 4px);
}
.wf-field input[aria-invalid="true"], .wf-field select[aria-invalid="true"], .wf-field textarea[aria-invalid="true"] { border-color: var(--wf-error, #b42318); }
.wf-choices { display: flex; flex-direction: column; gap: 6px; }
.wf-choice, .wf-field--checkbox .wf-label, .wf-field--consent .wf-label { display: flex; gap: 8px; align-items: center; }
.wf-help { margin: 0; font-size: 0.9em; opacity: 0.75; }
.wf-content { white-space: pre-line; }
.wf-error { margin: 0; color: var(--wf-error, #b42318); font-size: 0.9em; }
.wf-required { color: var(--wf-error, #b42318); }
.wf-status:empty { display: none; }
.wf-success { padding: 16px; border: 1px solid currentColor; border-radius: var(--wf-input-radius, 8px); }
.wf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.wf-submit { align-self: flex-start; }
.wf-nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.wf-back { font: inherit; background: transparent; border: 0; padding: 8px 0; text-decoration: underline; cursor: pointer; color: inherit; }
.wf-nav [hidden] { display: none; }
.wf-progress { margin: 0; font-size: 0.9em; opacity: 0.75; }
.wf-progress[hidden] { display: none; }
.wf-heading, .wf-step-title { margin: 0; }
.wf-image { display: block; max-width: 100%; height: auto; }
.wf-divider { width: 100%; border: 0; border-top: 1px solid currentColor; opacity: 0.2; margin: 0; }
/* Only the "custom" button style; "theme" keeps the theme's .button look. The
   inline block (.workflow-form) and the popup container (#wf-popups) both carry the attribute. */
[data-button-style="custom"] .wf-submit {
  font: inherit; cursor: pointer; padding: 12px 24px;
  border: 0; border-radius: var(--wf-button-radius, 4px);
  background: var(--wf-button-bg, currentColor);
  color: var(--wf-button-text, #fff);
}
[data-button-style="custom"] .wf-submit:disabled { opacity: 0.6; cursor: default; }

/* Popup (app embed). The layer is fixed over the page; --wf-overlay-opacity from the form's settings. */
.wf-popup { position: fixed; inset: 0; z-index: 2147483000; display: flex; pointer-events: none; }
.wf-popup--overlay { background: rgba(var(--wf-overlay-rgb, 0, 0, 0), var(--wf-overlay-opacity, 0.5)); pointer-events: auto; }
.wf-popup--modal { align-items: center; justify-content: center; padding: 16px; }
.wf-popup--slide_left { align-items: flex-end; justify-content: flex-start; padding: 16px; }
.wf-popup--slide_right { align-items: flex-end; justify-content: flex-end; padding: 16px; }
.wf-popup__dialog {
  position: relative; pointer-events: auto; display: flex; max-width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--wf-popup-bg, #fff); color: var(--wf-popup-text, #111); border-radius: var(--wf-popup-radius, 12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); background-size: cover; background-position: center;
}
.wf-popup--slide_left .wf-popup__dialog, .wf-popup--slide_right .wf-popup__dialog { max-width: min(420px, 100%); }
.wf-popup__body { padding: 32px 24px 24px; flex: 1 1 320px; min-width: 0; }
.wf-popup__image { width: 40%; min-width: 160px; object-fit: cover; }
.wf-popup__close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
.wf-popup__close:focus-visible, .wf-teaser:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.wf-teaser { position: fixed; bottom: 16px; z-index: 2147482999; padding: 10px 16px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; background: var(--wf-button-bg, #111); color: var(--wf-button-text, #fff); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); }
.wf-teaser--bottom_left { left: 16px; }
.wf-teaser--bottom_right { right: 16px; }
@media (max-width: 749px) {
  .wf-popup__dialog { flex-direction: column; }
  .wf-popup__image { width: 100%; max-height: 180px; }
}
@media (prefers-reduced-motion: no-preference) {
  .wf-popup__dialog { animation: wf-popup-in 160ms ease-out; }
  @keyframes wf-popup-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* The Liquid / HTML block: an image never wider than the form. */
.wf-html img { max-width: 100%; height: auto; }
