/* The native Sellfy offer, treated like a print from the EfikZara collection. */
.upsell-overlay:has(> form.upsell-modal) {
  background: #1b1239a8;
  padding: clamp(12px, 3vw, 28px);
  overflow: hidden auto;
}

.upsell-overlay form.upsell-modal {
  --offer-ink: #2b1a43;
  --offer-muted: #695576;
  --offer-rule: #d7c9df;
  position: relative;
  width: min(100%, 476px);
  max-width: 100%;
  max-height: calc(100dvh - clamp(24px, 6vw, 56px));
  margin: auto;
  padding: clamp(20px, 5vw, 34px);
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--offer-ink);
  background: #fcfaf6 var(--ez-paper-grain, none);
  border: 1px solid var(--offer-rule);
  border-radius: 0;
  box-shadow: 0 2px 0 #fff5 inset, 0 14px 48px #160d3973;
}

form.upsell-modal > .header {
  min-height: 0;
  padding: 0 32px 16px 0;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--offer-rule);
  background: transparent;
  color: var(--offer-ink);
  font: 570 clamp(19px, 4.3vw, 25px)/1.22 EZSpace, "Space Grotesk", sans-serif;
  letter-spacing: -.034em;
  text-wrap: pretty;
  text-align: left;
}

form.upsell-modal > .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--offer-muted);
  font: 400 25px/1 EZSpace, "Space Grotesk", sans-serif;
}

form.upsell-modal > .content {
  margin: 0;
  padding: 0;
  background: transparent;
}

form.upsell-modal .content .product-card {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  grid-template-rows: 1fr auto auto auto 1fr;
  column-gap: clamp(15px, 5vw, 30px);
  row-gap: 0;
  align-items: start;
  overflow: visible;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  text-align: left !important;
}

form.upsell-modal .product-card .image-container {
  position: relative;
  display: grid;
  place-items: center;
  grid-area: 1 / 1 / -1 / 2;
  align-self: center;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  min-width: 0;
  padding: 7px 7px 15px !important;
  margin: 0;
  overflow: visible;
  background: #faf7f1 var(--ez-paper-grain, none);
  border: 1px solid #e6dcea;
  border-radius: 0;
  box-shadow: 2px 5px 11px #3d214320;
  transform: rotate(-2.5deg);
}

form.upsell-modal .product-card .image-container::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -6px;
  left: 32%;
  width: 40%;
  height: 17px;
  background: #c4cef0b8 var(--ez-paper-grain, none);
  box-shadow: 0 1px 1px #25183e14;
  transform: rotate(5deg);
  pointer-events: none;
}

/* The shared product-card theme also draws tape on ::after. */
form.upsell-modal .product-card .image-container::after {
  content: none !important;
}

form.upsell-modal .product-card .image-container img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  min-height: 0;
  object-fit: contain;
  border-radius: 0;
  background: #ece6f5;
}

form.upsell-modal .product-card .name {
  grid-area: 2 / 2;
  align-self: end;
  margin: 0 0 8px !important;
  text-align: left;
  color: var(--offer-ink);
  font: 530 clamp(20px, 4.7vw, 30px)/1.06 EZSpace, "Space Grotesk", sans-serif;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}

form.upsell-modal .product-card .price-old {
  grid-area: 3 / 2;
  display: block;
  margin: 0 0 2px !important;
  text-align: left;
  color: var(--offer-muted);
  font-size: 14px;
  line-height: 1.3;
}

form.upsell-modal .product-card .price {
  grid-area: 4 / 2;
  margin: 0 !important;
  text-align: left;
  color: #4320b5;
  font: 620 clamp(29px, 7vw, 41px)/1.06 EZSpace, "Space Grotesk", sans-serif;
  letter-spacing: -.056em;
  overflow-wrap: anywhere;
}

form.upsell-modal > .actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 7px;
  margin: 23px 0 0;
  padding: 0;
}

form.upsell-modal .actions > .approve {
  --ez-action-bg: linear-gradient(108deg,#2b158a 4%,#5128b3 35%,#663596 58%,#3020a2 89%);
  grid-column: 1;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 49px;
  padding: 12px 16px;
  margin: 0;
  overflow: hidden;
  color: #fff;
  background: var(--ez-action-bg);
  border: 1px solid #5634ad;
  border-radius: 3px;
  box-shadow: 0 3px 0 #241365, inset 0 1px #ffffff36;
  font: 650 15px/1.22 EZSpace, "Space Grotesk", sans-serif;
  cursor: pointer;
}

form.upsell-modal .actions > .approve::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(117deg, transparent 32%, #fac4f147 43%, #c7dfff45 52%, transparent 64%);
  transform: translateX(-110%);
}

form.upsell-modal .actions > .cancel-action {
  grid-column: 1;
  justify-self: center;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  color: var(--offer-muted);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

form.upsell-modal button:focus-visible {
  outline: 2px solid #3217c6;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .upsell-overlay:has(> form.upsell-modal:not(.closing)) {
    animation: ez-offer-backdrop 240ms ease-out both;
  }

  .upsell-overlay:has(> form.upsell-modal:not(.closing))::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(610px, 106vw);
    aspect-ratio: 1;
    pointer-events: none;
    border-radius: 50%;
    background: conic-gradient(from 25deg, transparent 4%, #e7a5f9 20%,
      transparent 39%, #b2b8ff 67%, transparent 88%);
    mask-image: radial-gradient(circle, transparent 36%, #000 55%, transparent 71%);
    animation: ez-offer-vortex 430ms cubic-bezier(.23, 1, .32, 1) both;
  }

  .upsell-overlay form.upsell-modal:not(.closing) {
    transform-origin: center;
    animation: ez-offer-spring 470ms cubic-bezier(.23, 1, .32, 1) both;
  }

  form.upsell-modal:not(.closing) .actions > .approve {
    animation: ez-offer-hop 3s 100ms ease-in-out infinite both;
  }

  form.upsell-modal:not(.closing) .actions > .approve::before {
    animation: ez-offer-shine 3s 100ms linear infinite both;
  }

  form.upsell-modal:not(.closing) .actions > .approve:active,
  form.upsell-modal:not(.closing) .actions > .approve:active::before {
    animation-play-state: paused;
  }

  @keyframes ez-offer-backdrop {
    from { background-color: #1b123900; }
  }

  @keyframes ez-offer-vortex {
    0% { opacity: 0; transform: translate(-50%, -50%) rotate(-85deg) scale(.53); }
    30% { opacity: .51; }
    100% { opacity: 0; transform: translate(-50%, -50%) rotate(43deg) scale(1.1); }
  }

  @keyframes ez-offer-spring {
    0% { opacity: 0; transform: translateY(10px) rotate(-7deg) scale(.8); }
    32% { opacity: 1; }
    49% { transform: translateY(-2px) rotate(1.7deg) scale(1.036); }
    68% { transform: translateY(1px) rotate(-.85deg) scale(.988); }
    82% { transform: rotate(.32deg) scale(1.007); }
    100% { opacity: 1; transform: none; }
  }

  @keyframes ez-offer-hop {
    0%, 9%, 16%, 100% { transform: translateY(0); }
    5% { transform: translateY(-5px); }
    12% { transform: translateY(-2px); }
  }

  @keyframes ez-offer-shine {
    0% { transform: translateX(-110%); }
    20%, 100% { transform: translateX(110%); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .upsell-overlay form.upsell-modal:not(.closing) {
    animation: ez-offer-fade 160ms ease-out both;
  }

  @keyframes ez-offer-fade {
    from { opacity: 0; }
  }
}

.ez-cart-particle {
  position: fixed; top: var(--y); left: var(--x); z-index: 2147483000;
  width: var(--size); height: var(--size); color: var(--tone);
  pointer-events: none; line-height: 1; font: 700 var(--size)/1 system-ui, sans-serif;
  text-align: center; text-shadow: 0 0 6px #dba8ff;
  transform: translate(-50%, -50%);
  animation: ez-cart-particle-travel var(--duration) cubic-bezier(.19,.65,.32,1) both;
}
@keyframes ez-cart-particle-travel {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
  13% { opacity: 1; }
  66% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--spin)) scale(.62);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ez-cart-particle { display: none; }
}
