/* Dishco /affiliates/ — hero + principle strip + how it works */
.d-aff {
  font-family: var(--dishco-font-sans, "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  color: var(--dishco-text-strong, #333333);
  /*
   * Full-bleed via WP alignfull inside TT4 constrained post-content.
   * Match site chrome (header/footer inner 1120 + page padding).
   * Avoid 100vw (scrollbar offset). See has-global-padding fix below.
   */
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  overflow-x: clip;
}

/*
 * Bugfix: .has-global-padding > .alignfull only applies negative margins;
 * width stayed at the padded content box (~viewport - 2*padding), so the
 * block hugged the left edge (~102px left of header/footer center).
 * Grow width by both root paddings so inners (1120) center correctly.
 */
.wp-block-post-content.has-global-padding > .d-aff.alignfull,
.has-global-padding > .d-aff.alignfull {
  width: calc(100% + var(--wp--style--root--padding-left, 0px) + var(--wp--style--root--padding-right, 0px));
  max-width: none;
  margin-left: calc(-1 * var(--wp--style--root--padding-left, 0px)) !important;
  margin-right: calc(-1 * var(--wp--style--root--padding-right, 0px)) !important;
}

/*
 * Fallback only if alignfull is missing. Prefer alignfull (no 100vw).
 * main { overflow-x: clip } in dishco-chrome contains any residual bleed.
 */
.is-layout-constrained > .d-aff:not(.alignfull),
.wp-block-post-content > .d-aff:not(.alignfull) {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Hero — SideShift-style split (desktop) + left stack (mobile) */
.d-aff-hero {
  position: relative;
  padding: 56px 24px 72px; /* 24px matches header/footer horizontal padding */
  background: #ffffff;
  overflow: hidden;
}

.d-aff-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1120px; /* match .d-site-header__inner / .d-site-footer__inner */
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 28px 36px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

.d-aff-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: none;
  width: 100%;
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 8px;
}

.d-aff-hero__title {
  margin: 0;
  font-family: var(--dishco-font-sans, "Inter", system-ui, sans-serif);
  font-size: clamp(2.15rem, 4.4vw, 3.35rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #111111;
  text-align: left;
  max-width: 18ch;
}

.d-aff-hero__sub {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--dishco-text-secondary, #666666);
  max-width: 36rem;
  text-align: left;
}

.d-aff-hero__payout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
  width: 100%;
}

.d-aff-hero__payout-label {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #333333;
  text-align: left;
}

.d-aff-hero__payout-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.d-aff-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--dishco-border-strong, #E5E5E5);
  background: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #333333;
  line-height: 1;
  white-space: nowrap;
}

.d-aff-hero__chip-mark {
  display: inline-flex;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
}

.d-aff-hero__chip-mark--bank { background: #4B5563; }
.d-aff-hero__chip-mark--paypal { background: #003087; }
.d-aff-hero__chip-mark--venmo { background: #008CFF; }
.d-aff-hero__chip-mark--cashapp { background: #00D632; }

.d-aff-hero__trust {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--dishco-text-secondary, #666666);
  text-align: left;
}

.d-aff-hero__trust strong {
  color: #333333;
  font-weight: 600;
}

.d-aff-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 4px;
  overflow: visible;
}

/* Dishco lime bevel pill CTA (calculator / header family — no beam) */
.d-aff-hero__cta {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--dishco-lime, #58CC02);
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  border-bottom: 4px solid var(--dishco-lime-dark, #46A302);
  border-right: 1px solid var(--dishco-lime-dark, #46A302);
  box-shadow: none;
  outline: none;
  transform: translateY(0);
  transition: background 0.12s ease, transform 0.12s ease, border-bottom-width 0.12s ease;
}

.d-aff-hero__cta:hover,
.d-aff-hero__cta:focus-visible {
  background: var(--dishco-lime-dark, #46A302);
  color: #ffffff !important;
}

.d-aff-hero__cta:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--dishco-lime, #58CC02) 45%, transparent);
  outline-offset: 3px;
}

.d-aff-hero__cta:active {
  transform: translateY(4px);
  border-bottom-width: 0;
  border-right-color: transparent;
}

.d-aff-hero__media {
  position: relative;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
}

/* Soft Dishco green glow behind graphic (desktop + mobile) */
.d-aff-hero__media::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 48%;
  width: 118%;
  height: 118%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(
    ellipse 58% 52% at 50% 48%,
    rgba(88, 204, 2, 0.22) 0%,
    rgba(88, 204, 2, 0.10) 38%,
    rgba(88, 204, 2, 0.03) 62%,
    rgba(255, 255, 255, 0) 78%
  );
}

.d-aff-hero__media img,
.d-aff-hero__media .wp-block-image img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  border-radius: 24px;
  object-fit: contain;
}

@media (min-width: 901px) {
  .d-aff-hero__media {
    justify-content: flex-end;
  }

  .d-aff-hero__media img,
  .d-aff-hero__media .wp-block-image img {
    max-height: min(640px, 72vh);
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .d-aff-hero {
    padding: 28px 16px 40px; /* sync mobile horizontal pad with how + near header 14px */
    background:
      radial-gradient(
        ellipse 90% 55% at 50% 78%,
        rgba(88, 204, 2, 0.12) 0%,
        rgba(88, 204, 2, 0.04) 42%,
        rgba(255, 255, 255, 0) 70%
      ),
      #ffffff;
  }

  .d-aff-hero__inner {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 100%;
    align-items: stretch;
  }

  .d-aff-hero__copy {
    max-width: none;
    order: 1;
    gap: 14px;
    text-align: left;
    align-items: flex-start;
  }

  .d-aff-hero__media {
    order: 2;
    margin-top: 4px;
  }

  .d-aff-hero__title {
    font-size: clamp(1.85rem, 8.2vw, 2.45rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
    max-width: none;
    text-align: left;
  }

  .d-aff-hero__sub {
    font-size: 1.0625rem;
    line-height: 1.5;
    max-width: none;
    text-align: left;
  }

  .d-aff-hero__actions {
    width: 100%;
  }

  .d-aff-hero__cta {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 26px;
    font-size: 1rem;
    width: auto;
    min-width: 9.5rem;
  }

  .d-aff-hero__media img,
  .d-aff-hero__media .wp-block-image img {
    max-width: 100%;
    width: 100%;
  }

  .d-aff-hero__media::before {
    width: 110%;
    height: 105%;
    background: radial-gradient(
      ellipse 62% 55% at 50% 50%,
      rgba(88, 204, 2, 0.18) 0%,
      rgba(88, 204, 2, 0.07) 45%,
      rgba(255, 255, 255, 0) 72%
    );
  }
}

/* Principle strip (section 2) — white section, mirrored vs hero */
.d-aff-principle {
  padding: 40px 24px 72px;
  background: #ffffff;
}

.d-aff-principle__inner {
  max-width: 1120px; /* match site chrome shell */
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 40px 48px;
  align-items: center;
}

.d-aff-principle__media {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  order: 1;
}

.d-aff-principle__media img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 24px;
}

.d-aff-principle__copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 32rem;
  order: 2;
}

.d-aff-principle__title {
  margin: 0;
  font-family: var(--dishco-font-sans, "Inter", system-ui, sans-serif);
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #111111;
}

.d-aff-principle__body {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--dishco-text-secondary, #666666);
  max-width: 30rem;
}

@media (max-width: 900px) {
  .d-aff-principle {
    padding: 28px 16px 56px;
  }

  .d-aff-principle__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .d-aff-principle__copy {
    max-width: none;
    order: 1;
  }

  .d-aff-principle__media {
    order: 2;
  }

  .d-aff-principle__title {
    font-size: clamp(1.5rem, 6.5vw, 2rem);
  }

  .d-aff-principle__media img {
    max-width: 340px;
  }
}

/* How it works — SideShift-style zigzag + spine */
.d-aff-how {
  position: relative;
  padding: 56px 24px 80px;
  background: #ffffff;
  overflow: hidden;
}

.d-aff-how::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #d9d9d9 1px, transparent 1.2px);
  background-size: 18px 18px;
  opacity: 0.35;
}

.d-aff-how__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.d-aff-how__heading {
  margin: 0 0 40px;
  text-align: center;
  font-family: var(--dishco-font-sans, "Inter", system-ui, sans-serif);
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #111111;
}

.d-aff-how__track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 8px 0 4px;
}

.d-aff-how__spine {
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 50%;
  width: 0;
  border-left: 2px dashed #cfcfcf;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
}

.d-aff-how__step {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.d-aff-how__spacer {
  min-width: 0;
}

.d-aff-how__node {
  display: flex;
  justify-content: center;
  align-items: center;
}

.d-aff-how__num {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: var(--dishco-lime, #58CC02);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 700;
  box-shadow: 0 0 0 6px #ffffff;
  line-height: 1;
}

.d-aff-how__card-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.d-aff-how__step--left .d-aff-how__card-wrap {
  grid-column: 1;
  grid-row: 1;
  align-items: flex-end;
  text-align: right;
}

.d-aff-how__step--right .d-aff-how__card-wrap {
  grid-column: 3;
  grid-row: 1;
  align-items: flex-start;
  text-align: left;
}

.d-aff-how__step--left .d-aff-how__node {
  grid-column: 2;
  grid-row: 1;
}

.d-aff-how__step--right .d-aff-how__node {
  grid-column: 2;
  grid-row: 1;
}

.d-aff-how__step--left .d-aff-how__spacer {
  grid-column: 3;
  grid-row: 1;
}

.d-aff-how__step--right .d-aff-how__spacer {
  grid-column: 1;
  grid-row: 1;
}

.d-aff-how__card {
  width: 100%;
  max-width: 260px;
  box-sizing: border-box;
  /* Default: transparent shell — filled steps rely on art's own rounded box/glow */
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.d-aff-how__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1.5px dashed #d0d0d0;
  background: #fafafa;
  color: #888888;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 12px;
  box-sizing: border-box;
  line-height: 1.35;
}

.d-aff-how__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0;
}

/* Art already includes rounded frame + glow — no card chrome / clip */
.d-aff-how__media:has(img) {
  border: none;
  background: transparent;
  padding: 0;
  color: transparent;
  overflow: visible;
  aspect-ratio: auto;
}

.d-aff-how__label {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #111111;
  line-height: 1.25;
  max-width: 260px;
}

.d-aff-how__sub {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--dishco-text-secondary, #666666);
  max-width: 260px;
}

.d-aff-how__step--left .d-aff-how__label,
.d-aff-how__step--left .d-aff-how__sub {
  text-align: right;
}

.d-aff-how__step--right .d-aff-how__label,
.d-aff-how__step--right .d-aff-how__sub {
  text-align: left;
}

@media (max-width: 700px) {
  .d-aff-how {
    padding: 40px 16px 64px;
  }

  .d-aff-how__heading {
    margin-bottom: 28px;
    font-size: clamp(1.5rem, 6.5vw, 2rem);
  }

  .d-aff-how__track {
    gap: 22px;
  }

  .d-aff-how__step {
    grid-template-columns: 1fr 36px 1fr;
    gap: 8px;
  }

  .d-aff-how__num {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
    box-shadow: 0 0 0 5px #ffffff;
  }

  .d-aff-how__card {
    max-width: 100%;
    padding: 0;
  }

  .d-aff-how__label,
  .d-aff-how__sub {
    max-width: 100%;
  }

  .d-aff-how__media {
    font-size: 0.6875rem;
  }
}

@media (min-width: 901px) {
  .d-aff-how__inner {
    max-width: 880px;
  }

  .d-aff-how__card {
    max-width: 300px;
  }

  .d-aff-how__label,
  .d-aff-how__sub {
    max-width: 300px;
  }
}


/* Sticky apply bar — shows after hero CTA scrolls away */
.d-aff-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  transform: translateY(110%);
  transition: transform 0.22s ease;
  pointer-events: none;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
}
.d-aff-sticky.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}
.d-aff-sticky__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.d-aff-sticky__text {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  line-height: 1.3;
}
.d-aff-sticky__cta {
  appearance: none;
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--dishco-lime, #58CC02);
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  border-bottom: 4px solid var(--dishco-lime-dark, #46A302);
  border-right: 1px solid var(--dishco-lime-dark, #46A302);
  box-shadow: none;
  outline: none;
  transform: translateY(0);
  transition: background 0.12s ease, transform 0.12s ease, border-bottom-width 0.12s ease;
  box-sizing: border-box;
}
.d-aff-sticky__cta:hover,
.d-aff-sticky__cta:focus-visible {
  background: var(--dishco-lime-dark, #46A302);
  color: #ffffff !important;
}
.d-aff-sticky__cta:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--dishco-lime, #58CC02) 45%, transparent);
  outline-offset: 3px;
}
.d-aff-sticky__cta:active {
  transform: translateY(4px);
  border-bottom-width: 0;
  border-right-color: transparent;
}
body.d-aff-sticky-on .d-aff {
  padding-bottom: 72px;
}
@media (max-width: 600px) {
  .d-aff-sticky__inner {
    padding: 10px 14px;
  }
  .d-aff-sticky__text {
    font-size: 13px;
  }
  .d-aff-sticky__cta {
    height: 42px;
    min-height: 42px;
    padding: 0 22px;
    font-size: 0.95rem;
  }
  body.d-aff-sticky-on .d-aff {
    padding-bottom: 68px;
  }
}
