.promo-card {
  display: flex;
  align-items: flex-start;
  align-self: stretch;
  background: linear-gradient(235deg, #FFF 0%, #F0EEE7 100%);
  border-radius: 16px;
  box-shadow: 0 12px 24px 0 rgba(0, 0, 0, 0.06);
  padding: 40px 0;
  margin: 0 auto 56px;
  width: 100%;
  max-width: 1017px;
  box-sizing: border-box;
}


.promo-card__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 40px 0 32px;
  flex: 1 0 0;
}

.promo-card__icon {
  flex-shrink: 0;
  width: 136.258px;
  height: 130.332px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform-origin: 50% 100%;
  animation: promoGiftBreathe 2s ease-in-out infinite;
  animation-play-state: paused;
}

.promo-card.is-revealed .promo-card__icon img.is-loaded {
  animation-play-state: running;
}


@keyframes promoGiftBreathe {
  0%, 100% { transform: scaleY(1)     scaleX(1)    translateY(0); }
  50%      { transform: scaleY(1.035) scaleX(0.97) translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .promo-card__icon img {
    animation: none;
  }
}

.promo-card__content {
  flex: 1 1 auto;
  min-width: 0;
}

.promo-card__title {
  color: var(--Primary, #222);
  leading-trim: both;
  text-edge: cap;
  text-box: trim-both cap alphabetic;
  font-feature-settings: 'liga' off, 'clig' off;
  font-family: Nunito;
  font-size: 24px;
  font-style: normal;
  font-weight: 800;
  line-height: 32px;
  margin: 0 0 24px;
}

.promo-card__description {
  color: var(--Primary, #222);
  leading-trim: both;
  text-edge: cap;
  text-box: trim-both cap alphabetic;
  font-feature-settings: 'liga' off, 'clig' off;
  font-family: Nunito;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 140%;
  margin: 0;
  margin-bottom: unset !important;
}

.promo-card__description strong {
  color: var(--Primary, #222);
  leading-trim: both;
  text-edge: cap;
  font-feature-settings: 'liga' off, 'clig' off;
  font-family: Nunito;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 24px;
}

.promo-card__code {
  flex-shrink: 0;
  display: flex;
  width: 243px;
  height: 65px;
  padding: 8px 5px 8px 32px;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: none;
  border-radius: 64px;
  background: var(--Gradient-Darkside, linear-gradient(143deg, #222 0.72%, #000 100%));
  color: #FFF;
  cursor: pointer;
  box-sizing: border-box;
}

.promo-card__code-text {
  color: var(--Shades-Dark-Side-White, #FFF);
  leading-trim: both;
  text-edge: cap;
  text-box: trim-both cap alphabetic;
  font-feature-settings: 'liga' off, 'clig' off;
  font-family: Nunito;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: 3px;
  padding-left: 8px;
}

.promo-card__code-icon {
  display: flex;
  padding: 16px;
  justify-content: center;
  align-items: center;
  border-radius: 64px;
  background: var(--Accent-Green, #22E243);
  color: #000;
  position: relative;
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}

.promo-card__code-icon svg {
  display: block;
  width: 24px;
  height: 24px;
  transition: opacity .25s ease, transform .4s cubic-bezier(.4, 0, .2, 1);
}

.promo-card__code-icon-check {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
}

/* Icon — upright by default, slides left + tilts to -20.267° on hover, returns upright when copied. */
.promo-card__code-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 49px;
  height: 49px;
  padding: 0;
  z-index: 2;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    right .45s cubic-bezier(.4, 0, .2, 1),
    left .45s cubic-bezier(.4, 0, .2, 1),
    transform .45s cubic-bezier(.4, 0, .2, 1);
}

/* On hover/copied, icon slides LEFT until the visible group [SVG + gap + text] is centered.
   Math: visible group width ≈ 24 (SVG) + 8 (gap) + 110 (text "COPY CODE") = 142.
   SVG-left = (W-142)/2.  Icon container left = SVG-left - 12.5 = (W-167)/2.
   Container right edge = (W-167)/2 + 49 = (W-69)/2 from button-left.
   In CSS → right: 100% - (W-69)/2 = calc(50% + 34.5px). */
.promo-card__code.is-hover .promo-card__code-icon {
  right: calc(50% + 34.5px);
  transform: rotate(-20.267deg);
  animation: promoCodeIconHoverIn .4s cubic-bezier(.4, 0, .2, 1);
}

@keyframes promoCodeIconHoverIn {
  0%   { transform: rotate(0deg) scale(.9); }
  40%  { transform: rotate(-25deg) scale(1.18); }
  70%  { transform: rotate(-18deg) scale(.97); }
  100% { transform: rotate(-20.267deg) scale(1); }
}

.promo-card__code.is-copied .promo-card__code-icon-copy {
  opacity: 0;
  transform: scale(.6);
}

.promo-card__code.is-copied .promo-card__code-icon-check {
  opacity: 1;
}

/* Mobile resting state — after the COPIED! flash on touch devices, .is-rested is added.
   Keeps the green/filled pill (from .is-copied) but flips the icon back to "copy"
   to match the swapped-back "Copy code" label. */
.promo-card__code.is-copied.is-rested .promo-card__code-icon-copy {
  opacity: 1;
  transform: scale(1);
}

.promo-card__code.is-copied.is-rested .promo-card__code-icon-check {
  opacity: 0;
}

.promo-card__code {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Green fill — starts as the icon-sized pill on the right, expands to fill the button on hover/active.
   All four sides transition the same speed so when we shrink back from the copied state
   (top/right/bottom/left/width) they collapse in unison instead of one-at-a-time. */
.promo-card__code::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 8px;
  width: 49px;
  border-radius: 64px;
  background: var(--Accent-Green, #22E243);
  z-index: 1;
  pointer-events: none;
  transition:
    top .45s cubic-bezier(.4, 0, .2, 1),
    right .45s cubic-bezier(.4, 0, .2, 1),
    bottom .45s cubic-bezier(.4, 0, .2, 1),
    width .45s cubic-bezier(.4, 0, .2, 1),
    background-color .35s ease;
}

.promo-card__code.is-hover::before {
  width: calc(100% - 16px);
}

/* Copied state — pill fills the ENTIRE button (no 8px gap around).
   The transition picks up width/inset/border-radius so it morphs from the
   hover-pill (rounded, 8px gap) into the full button area. */
.promo-card__code.is-copied::before {
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  border-radius: 64px;
  background: var(--Muted-Green, #20BB3B);
  transition:
    top .35s cubic-bezier(.4, 0, .2, 1),
    right .35s cubic-bezier(.4, 0, .2, 1),
    bottom .35s cubic-bezier(.4, 0, .2, 1),
    width .35s cubic-bezier(.4, 0, .2, 1),
    background-color .35s ease;
}

/* Copied state — icon position recalculated for "COPIED!" text (~90px wide vs "COPY CODE" ~110px).
   Group: 24 (SVG) + 8 (gap) + 90 (COPIED!) = 122 → icon container right = calc(50% + 24.5px).
   Fast transition (.15s) so the icon snaps into place quickly behind the bounce animation. */
.promo-card__code.is-copied .promo-card__code-icon {
  right: calc(50% + 24.5px);
  transform: rotate(0deg);
  transition:
    right .15s cubic-bezier(.4, 0, .2, 1),
    transform .15s cubic-bezier(.4, 0, .2, 1);
}

/* Code text sits BELOW the green pill — when the pill expands from right→left it covers
   the text gradually, creating a soft "shadow wipe" feel as the code disappears. */
.promo-card__code-text {
  position: relative;
  z-index: 0;
  transition: opacity .45s cubic-bezier(.4, 0, .2, 1);
}

.promo-card__code.is-copied .promo-card__code-text {
  opacity: 0;
}
.promo-card__code.is-hover .promo-card__code-text {
  opacity: 0;
}

/* Hover/active text — sits 8px after the visible SVG icon (not after the 49px container).
   With centered group [24 SVG + 8 gap + 110 text]: SVG-right = (W-142)/2 + 24 = (W-94)/2,
   text-left = SVG-right + 8 = (W-78)/2 → padding-left: calc(50% - 39px). */
.promo-card__code-hover-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 16px 0 calc(50% - 39px);
  color: #000;
  font-family: Nunito;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transform: translateX(60%);
  transition:
    opacity .3s ease,
    transform .45s cubic-bezier(.4, 0, .2, 1);
}

.promo-card__code.is-copied .promo-card__code-hover-text {
  opacity: 1;
  transform: translateX(0);
  /* Override padding-left from base rule (calc(50% - 39px) for COPY CODE)
     to position text after the recalculated icon offset for COPIED!. */
  padding-left: calc(50% - 29px);
  /* Text bursts in synced with the button bounce — hidden during the squash,
     pops in opacity + slight scale during the bounce peak. */
  animation: promoCodeTextBoom .45s cubic-bezier(.4, 0, .2, 1) both;
  transition: none;
}

@keyframes promoCodeTextBoom {
  0%   { opacity: 0; transform: translateX(0) scale(.85); }
  35%  { opacity: 0; transform: translateX(0) scale(.95); }
  60%  { opacity: 1; transform: translateX(0) scale(1.08); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
.promo-card__code.is-hover .promo-card__code-hover-text {
  opacity: 1;
  transform: translateX(0);
  transition-delay: .2s;
  animation: promoCodeTextHoverIn .4s cubic-bezier(.4, 0, .2, 1) .05s both;
}

@keyframes promoCodeTextHoverIn {
  0%   { opacity: 0; transform: translateX(15px) scale(.92); }
  60%  { opacity: 1; transform: translateX(0) scale(1.05); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* COPIED click-feedback bounce — fires once when .is-copied is added. */
.promo-card__code.is-copied {
  animation: promoCodeCopiedJump .45s cubic-bezier(.4, 0, .2, 1);
}

@keyframes promoCodeCopiedJump {
  0%   { transform: scale(1); }
  15%  { transform: scale(.9); }
  45%  { transform: scale(1.08); }
  75%  { transform: scale(.98); }
  100% { transform: scale(1); }
}

.promo-card__code.is-copied .promo-card__code-icon {
  transform: scale(1.08) rotate(-6deg);
}

@media (max-width: 991px), (max-height: 600px) {
  .promo-card {
    padding: 24px 0;
    margin: 16px auto 32px;
  }

  .promo-card__inner {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "icon  title"
      "code  code"
      "desc  desc";
    column-gap: 24px;
    row-gap: 24px;
    padding: 0 32px;
    align-items: center;
  }

  .promo-card__icon {
    grid-area: icon;
    width: clamp(70px, 25.26vw, 96px);
    height: auto;
    aspect-ratio: 23/22;
    align-self: center;
  }

  .promo-card__icon img {
    width: 100%;
    height: 100%;
    aspect-ratio: 23/22;
  }

  .promo-card__content {
    display: contents;
  }

  .promo-card__title {
    grid-area: title;
    color: var(--Primary, #222);
    font-family: Nunito;
    font-size: 18px;
    font-style: normal;
    font-weight: 700;
    line-height: 22px;
    margin: 0;
  }

  .promo-card__description {
    grid-area: desc;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    margin-top: 16px;
  }

  .promo-card__description strong {
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
  }

  .promo-card__code {
    grid-area: code;
    width: 100%;
    justify-self: stretch;
    padding: 8px 57px 8px 8px;
    gap: 0;
  }

  .promo-card__code-text {
    flex: 1;
    text-align: center;
    font-size: 24px;
  }
}

@media (max-width: 400px) and (max-height: 740px), (max-height: 600px) {
  .promo-card__inner {
    row-gap: 0;
  }
  .promo-card__description {
    margin-top: 24px;
  }
  .promo-card__icon,
  .promo-card__icon img {
    width: 70px;
    height: 66.956px;
    aspect-ratio: 23/22;
  }
}

@media (max-width: 380px) {
  .promo-card__code-text {
    font-size: 20px;
  }
}
