.bw-popup {
  position: fixed;
  inset: 0;
  z-index: var(--z-index-popover, 20);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bw-popup[hidden] {
  display: none;
}

.bw-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 45%);
  opacity: 0;
  transition: opacity 260ms ease;
}

.bw-popup.is-open .bw-popup__backdrop {
  opacity: 1;
}

.bw-popup__card {
  position: relative;
  box-sizing: border-box;
  display: flex;
  width: 840px;
  max-width: 100%;
  height: 520px;
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  background: var(--bw-cream);
  border: 1px solid #e7e1d5;
  border-radius: 16px;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.bw-popup.is-open .bw-popup__card {
  opacity: 1;
  transform: none;
}

.bw-popup--media-left .bw-popup__card {
  flex-direction: row-reverse;
}

.bw-popup__col {
  box-sizing: border-box;
  flex: 1 1 50%;
  width: 50%;
  min-width: 0;
}

.bw-popup__col--content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 40px;
}

.bw-popup__close {
  position: absolute;
  inset-block-start: 24px;
  inset-inline-end: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--bw-ink);
  cursor: pointer;
  background: rgb(0 0 0 / 3%);
  border: 0;
  border-radius: 16px;
}

.bw-popup__close svg {
  display: block;
  width: 14px;
  height: 14px;
}

.bw-popup__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  width: 100%;
}

.bw-popup__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
}

.bw-popup__logo-mark {
  display: block;
  width: 166px;
  height: 20px;
  color: var(--bw-ink);
}

.bw-popup__logo-image {
  display: block;
  width: auto;
  max-width: 200px;
  height: 20px;
  object-fit: contain;
}

.bw-popup__headline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding-block-end: 30px;
}

.bw-popup__eyebrow,
.bw-popup__subline {
  width: 100%;
  margin: 0;
  font-family: var(--bw-font-display);
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--bw-ink);
  text-align: center;
}

.bw-popup__offer {
  width: 100%;
  margin: 0;
  font-family: var(--bw-font-heading);
  font-size: 64px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0;
  color: var(--bw-ink);
  text-align: center;
}

.bw-popup__step {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  width: 100%;
}

.bw-popup__step[hidden] {
  display: none;
}

.bw-popup__question {
  margin: 0;
  font-family: var(--bw-font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--bw-ink);
  text-align: center;
}

.bw-popup__focus {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.bw-popup__chip {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font-family: var(--bw-font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--bw-cream);
  cursor: pointer;
  background: var(--bw-ink);
  border: 1px solid var(--bw-ink);
  border-radius: 999px;
  transition:
    background-color var(--bw-dur-brisk) var(--bw-ease-standard),
    color var(--bw-dur-brisk) var(--bw-ease-standard);
}

.bw-popup__chip:hover,
.bw-popup__chip:focus-visible {
  color: var(--bw-ink);
  background: var(--bw-accent);
  border-color: var(--bw-accent);
  outline: none;
}

.bw-popup__chip[aria-pressed="true"] {
  color: var(--bw-ink);
  background: var(--bw-accent);
  border-color: var(--bw-accent);
}

.bw-popup__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.bw-popup__field {
  width: 100%;
  margin: 0;
}

.bw-popup .bw-popup__field .field__input {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  padding: 0 20px;
  font-family: var(--bw-font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--bw-ink);
  background: transparent;
  border: 0 !important;
  border-radius: 999px;
}

.bw-popup .bw-popup__field::after {
  border-color: var(--bw-ink);
  border-width: 1px;
  border-radius: 999px;
}

.bw-popup .bw-popup__field .field__label {
  inset-inline-start: 20px;
}

.bw-popup__submit {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font-family: var(--bw-font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--bw-ink);
  cursor: pointer;
  background: var(--bw-accent);
  border: 0;
  border-radius: 999px;
}

.bw-popup__note {
  margin: 0;
  font-family: var(--bw-font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--bw-ink);
  text-align: center;
}

.bw-popup__note--error {
  color: var(--bw-error);
}

.bw-popup__code {
  margin: 8px 0 0;
  font-family: var(--bw-font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--bw-ink);
  text-align: center;
}

.bw-popup__code-value {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.bw-popup__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 16px;
}

.bw-popup__decline {
  padding: 0;
  font-family: var(--bw-font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--bw-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.bw-popup__col--media {
  overflow: hidden;
  background: var(--bw-card);
}

.bw-popup__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 959px) {
  .bw-popup {
    align-items: flex-end;
    padding: 0;
  }

  .bw-popup__card {
    flex-direction: column-reverse !important;
    width: 100%;
    height: auto;
    max-height: 92dvh;
    overflow-y: auto;
    border-inline: 0;
    border-block-end: 0;
    border-start-start-radius: 20px;
    border-start-end-radius: 20px;
    border-end-start-radius: 0;
    border-end-end-radius: 0;
    transform: translateY(24px);
  }

  .bw-popup__col {
    flex: 0 0 auto !important;
    width: 100% !important;
  }

  /* The dismiss link is the only way past the popup for a shopper who does not want to sign up. */
  .bw-popup__decline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }

  .bw-popup__col--media {
    height: 190px;
  }

  .bw-popup__col--content {
    gap: 20px;
    padding: 24px 20px 28px !important;
  }

  .bw-popup__close {
    inset-block-start: 12px !important;
    inset-inline-end: 12px !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 22px !important;
  }

  .bw-popup__headline {
    padding-block-end: 8px !important;
  }

  .bw-popup__offer {
    font-size: 48px !important;
  }

  .bw-popup__chip,
  .bw-popup__submit,
  .bw-popup .bw-popup__field .field__input {
    height: 48px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bw-popup__backdrop,
  .bw-popup__card,
  .bw-popup__chip {
    transition: none !important;
  }

  .bw-popup__card {
    transform: none !important;
  }
}
