.affiliate-popup {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.affiliate-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(32 21 18 / 55%);
}

.affiliate-popup__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(260px, 0.95fr);
  width: min(920px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 18px;
  background: #fbf6ee;
  color: #201512;
  box-shadow: 0 24px 60px rgb(32 21 18 / 28%);
}

.affiliate-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 92%);
  color: #201512;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.affiliate-popup__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 32px 28px;
  background-color: #fbf6ee;
  background-image: radial-gradient(rgb(32 21 18 / 16%) 1px, transparent 1px);
  background-size: 16px 16px;
}

.affiliate-popup__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.affiliate-popup__pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ba0707;
  color: #fbf6ee;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  line-height: 1;
}

.affiliate-popup__note {
  font-family: var(--font-body);
  font-size: 13px;
  color: #5c5148;
}

.affiliate-popup__heading {
  margin: 0;
  max-width: 420px;
  font-family: var(--font-heading);
  font-size: clamp(40px, 4vw, 56px);
  font-weight: 400;
  line-height: 0.95;
  text-transform: none;
  color: #201512;
}

.affiliate-popup__accent {
  color: #ba0707;
}

.affiliate-popup__text {
  margin: 16px 0 0;
  max-width: 420px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  color: #3d332c;
}

.affiliate-popup__highlight {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.affiliate-popup__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.affiliate-popup__stat {
  padding: 14px 16px 12px;
  border-radius: 12px;
  background: #fff;
}

.affiliate-popup__stat strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  color: #ba0707;
}

.affiliate-popup__stat:last-child strong {
  color: #201512;
}

.affiliate-popup__stat span {
  display: block;
  margin-top: 6px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #5c5148;
}

.affiliate-popup__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 22px;
  padding: 16px 24px;
  border: 0;
  border-radius: 10px;
  background: #ba0707;
  color: #fbf6ee;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.4px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.affiliate-popup__button:hover {
  background: #8f0505;
}

.affiliate-popup__later {
  align-self: center;
  margin-top: 14px;
  color: #6d645d;
  font-family: var(--font-body);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.affiliate-popup__media {
  position: relative;
  min-height: 100%;
}

.affiliate-popup__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.affiliate-popup__status {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 94%);
  color: #201512;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.affiliate-popup__status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1f9d55;
}

.affiliate-popup__offer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 280px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgb(255 255 255 / 94%);
}

.affiliate-popup__offer-kicker {
  color: #ba0707;
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 1;
}

.affiliate-popup__offer-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.affiliate-popup__offer-copy strong {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.2;
}

.affiliate-popup__offer-copy small {
  font-family: var(--font-body);
  font-size: 12px;
  color: #5c5148;
}

.affiliate-popup__tab {
  display: none;
}

.affiliate-popup.is-minimized {
  inset: auto;
  top: 42%;
  left: 0;
  z-index: 90;
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  pointer-events: none;
}

.affiliate-popup.is-minimized .affiliate-popup__backdrop,
.affiliate-popup.is-minimized .affiliate-popup__dialog {
  display: none;
}

.affiliate-popup.is-minimized .affiliate-popup__tab {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 36px;
  min-height: 88px;
  pointer-events: auto;
  overflow: hidden;
  border-radius: 0 10px 10px 0;
  background-color: #fbf6ee;
  background-image: radial-gradient(rgb(32 21 18 / 16%) 1px, transparent 1px);
  background-size: 10px 10px;
  box-shadow: 3px 6px 16px rgb(32 21 18 / 18%);
  animation: affiliate-popup-paper 0.35s ease;
}

.affiliate-popup.is-minimized .affiliate-popup__tab::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: linear-gradient(225deg, #fff 46%, #d8cfc4 46%);
}

.affiliate-popup__tab-open {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  padding: 20px 4px 10px;
  border: 0;
  background: transparent;
  color: #201512;
  cursor: pointer;
}

.affiliate-popup__tab-mark {
  color: #ba0707;
  font-size: 10px;
  line-height: 1;
}

.affiliate-popup__tab-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.affiliate-popup__tab-close {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 1;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(32 21 18 / 8%);
  color: #201512;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.affiliate-popup__tab-close:hover {
  background: rgb(32 21 18 / 16%);
}

@keyframes affiliate-popup-paper {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

@media (max-width: 759px) {
  .affiliate-popup {
    padding: 12px;
  }

  .affiliate-popup__dialog {
    grid-template-columns: 1fr;
  }

  .affiliate-popup__media {
    order: -1;
    height: 220px;
    min-height: 0;
  }

  .affiliate-popup__copy {
    padding: 24px 18px 22px;
  }

  .affiliate-popup__stats {
    grid-template-columns: 1fr 1fr;
  }
}
